Added support for remove() and unlink().
This commit is contained in:
parent
a8ecb11013
commit
7292b538bc
4 changed files with 34 additions and 0 deletions
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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"),
|
||||
}
|
||||
|
|
15
plat/linux386/libsys/remove.c
Normal file
15
plat/linux386/libsys/remove.c
Normal 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);
|
||||
}
|
15
plat/linux386/libsys/unlink.c
Normal file
15
plat/linux386/libsys/unlink.c
Normal 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);
|
||||
}
|
Loading…
Reference in a new issue