Added support for remove() and unlink().

This commit is contained in:
dtrg 2010-09-27 20:44:49 +00:00
parent a8ecb11013
commit 7292b538bc
4 changed files with 34 additions and 0 deletions

View file

@ -55,6 +55,8 @@ extern int read(int fd, void* buffer, size_t count);
extern int write(int fd, void* buffer, size_t count);
extern off_t lseek(int fildes, off_t offset, int whence);
extern int fcntl(int fd, int op, ...);
extern int unlink(const char* path);
extern int remove(const char* path);
/* Special variables */

View file

@ -26,6 +26,8 @@ libsys_linux386 = acklibrary {
ackfile (d.."sbrk.c"),
ackfile (d.."signal.c"),
ackfile (d.."write.c"),
ackfile (d.."unlink.c"),
ackfile (d.."remove.c"),
install = pm.install("%BINDIR%lib/%PLATFORM%/libsys.a"),
}

View file

@ -0,0 +1,15 @@
/* $Source$
* $State$
* $Revision$
*/
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <stdarg.h>
#include "libsys.h"
int remove(const char* path)
{
return unlink(path);
}

View file

@ -0,0 +1,15 @@
/* $Source$
* $State$
* $Revision$
*/
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <stdarg.h>
#include "libsys.h"
int unlink(const char* path)
{
return _syscall(__NR_unlink, (quad) path, 0, 0);
}