Added support for remove() and unlink().
authordtrg <none@none>
Mon, 27 Sep 2010 20:44:49 +0000 (20:44 +0000)
committerdtrg <none@none>
Mon, 27 Sep 2010 20:44:49 +0000 (20:44 +0000)
plat/linux386/include/unistd.h
plat/linux386/libsys/pmfile
plat/linux386/libsys/remove.c [new file with mode: 0644]
plat/linux386/libsys/unlink.c [new file with mode: 0644]

index 1002da5..715e321 100644 (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 */
 
index 6ab47b5..45b3e28 100644 (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"),
 }
diff --git a/plat/linux386/libsys/remove.c b/plat/linux386/libsys/remove.c
new file mode 100644 (file)
index 0000000..d1978d1
--- /dev/null
@@ -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);
+}
diff --git a/plat/linux386/libsys/unlink.c b/plat/linux386/libsys/unlink.c
new file mode 100644 (file)
index 0000000..67c4dc1
--- /dev/null
@@ -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);
+}