[fusl] Don't syscall(SYS_unlink) in stdio
This replaces an inlined version of unlink(2) with calls to it.
R=vardhan@google.com
Review URL: https://codereview.chromium.org/1717423002 .
diff --git a/fusl/src/stdio/remove.c b/fusl/src/stdio/remove.c
index ca5267b..3f9417f 100644
--- a/fusl/src/stdio/remove.c
+++ b/fusl/src/stdio/remove.c
@@ -1,14 +1,11 @@
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
+#include <unistd.h>
#include "syscall.h"
int remove(const char* path) {
-#ifdef SYS_unlink
- int r = __syscall(SYS_unlink, path);
-#else
- int r = __syscall(SYS_unlinkat, AT_FDCWD, path, 0);
-#endif
+ int r = unlink(path);
#ifdef SYS_rmdir
if (r == -EISDIR)
r = __syscall(SYS_rmdir, path);
diff --git a/fusl/src/stdio/tmpfile.c b/fusl/src/stdio/tmpfile.c
index a9a608b..2f463a9 100644
--- a/fusl/src/stdio/tmpfile.c
+++ b/fusl/src/stdio/tmpfile.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <fcntl.h>
+#include <unistd.h>
#include "stdio_impl.h"
#define MAXTRIES 100
@@ -16,11 +17,7 @@
__randname(s + 13);
fd = sys_open(s, O_RDWR | O_CREAT | O_EXCL, 0600);
if (fd >= 0) {
-#ifdef SYS_unlink
- __syscall(SYS_unlink, s);
-#else
- __syscall(SYS_unlinkat, AT_FDCWD, s, 0);
-#endif
+ unlink(s);
f = __fdopen(fd, "w+");
if (!f)
__syscall(SYS_close, fd);