* syscalls.cc (remove): New function, overriding the newlib

implementation.
This commit is contained in:
Corinna Vinschen
2000-12-19 20:43:41 +00:00
parent 602f8b5aba
commit 3112d7a41c
2 changed files with 24 additions and 0 deletions

View File

@@ -166,6 +166,25 @@ done:
return res;
}
extern "C" int
remove (const char *ourname)
{
path_conv win32_name (ourname, PC_SYM_NOFOLLOW | PC_FULL);
if (win32_name.error)
{
set_errno (win32_name.error);
syscall_printf ("-1 = remove (%s)", ourname);
return -1;
}
DWORD atts = win32_name.file_attributes ();
if (atts != 0xffffffff && atts & FILE_ATTRIBUTE_DIRECTORY)
return rmdir (ourname);
return _unlink (ourname);
}
extern "C" pid_t
_getpid ()
{