summaryrefslogtreecommitdiff
path: root/src/stdio/remove.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/remove.c')
-rw-r--r--src/stdio/remove.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/stdio/remove.c b/src/stdio/remove.c
index 2a10e443..39b5a74c 100644
--- a/src/stdio/remove.c
+++ b/src/stdio/remove.c
@@ -1,15 +1,18 @@
+#ifndef _POSIX_SOURCE
+#define _POSIX_SOURCE
+#define POSIX_FORCED
+#endif
+
#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
-#ifdef _POSIX_SOURCE
-#include "sys/types.h"
-#include "sys/stat.h"
-#include "unistd.h"
-#else
- struct stat { int st_mode; };
-#define stat(f, b) (void)f
-#define S_ISDIR(m) (m = 0)
-#define rmdir(f) (-1)
-#define unlink(f) (-1)
+#ifdef POSIX_FORCED
+#include "_syscall.h"
+#define stat(_f, _b) __scall2(stat, _f, _b)
+#define rmdir(_f) __scall1(rmdir, _f)
+#define unlink(_f) __scall1(unlink, _f)
#endif
/** delete a file **/
@@ -31,7 +34,5 @@ open that file will fail unless creating a new file.
/*
IMPLEMENTATION(Whether the file is removed if it is open)
-*/
-/*
STDC(1)
*/