summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/unlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/unlink.c')
-rw-r--r--libc/sysdeps/linux/common/unlink.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/unlink.c b/libc/sysdeps/linux/common/unlink.c
index d4504d4df..317bc5da8 100644
--- a/libc/sysdeps/linux/common/unlink.c
+++ b/libc/sysdeps/linux/common/unlink.c
@@ -10,5 +10,13 @@
#include <sys/syscall.h>
#include <unistd.h>
+#if defined __NR_unlinkat && !defined __NR_unlink
+# include <fcntl.h>
+int unlink(const char *pathname)
+{
+ return unlinkat(AT_FDCWD, pathname, 0);
+}
+#else
_syscall1(int, unlink, const char *, pathname)
+#endif
libc_hidden_def(unlink)