summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/mkdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/mkdir.c')
-rw-r--r--libc/sysdeps/linux/common/mkdir.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/mkdir.c b/libc/sysdeps/linux/common/mkdir.c
index fbc587d3d..bee3e3e7c 100644
--- a/libc/sysdeps/linux/common/mkdir.c
+++ b/libc/sysdeps/linux/common/mkdir.c
@@ -10,8 +10,15 @@
#include <sys/syscall.h>
#include <sys/stat.h>
+#if defined __NR_mkdirat && !defined __NR_mkdir
+# include <fcntl.h>
+int mkdir(const char *pathname, mode_t mode)
+{
+ return mkdirat(AT_FDCWD, pathname, mode);
+}
-#define __NR___syscall_mkdir __NR_mkdir
+#else
+# define __NR___syscall_mkdir __NR_mkdir
static __inline__ _syscall2(int, __syscall_mkdir, const char *, pathname,
__kernel_mode_t, mode)
@@ -19,4 +26,5 @@ int mkdir(const char *pathname, mode_t mode)
{
return (__syscall_mkdir(pathname, mode));
}
+#endif
libc_hidden_def(mkdir)