]> Git Repo - uclibc-ng.git/commitdiff
mkdir: Use mkdirat if arch does not have the mkdir syscall
authorMarkos Chandras <[email protected]>
Wed, 10 Oct 2012 14:10:27 +0000 (15:10 +0100)
committerBernhard Reutner-Fischer <[email protected]>
Wed, 20 Feb 2013 12:45:11 +0000 (13:45 +0100)
Signed-off-by: Markos Chandras <[email protected]>
Signed-off-by: Bernhard Reutner-Fischer <[email protected]>
include/sys/stat.h
libc/sysdeps/linux/common/mkdir.c
libc/sysdeps/linux/common/mkdirat.c

index 1709cece7c2ac45bb61a09611e6af88d0046b1c0..9283a8971d0fee52242e5a27b4dbcafd972b70d7 100644 (file)
@@ -335,6 +335,7 @@ libc_hidden_proto(mkdir)
    with FD.  */
 extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
      __THROW __nonnull ((2));
+libc_hidden_proto(mkdirat)
 #endif
 
 /* Create a device file named PATH, with permission and special bits MODE
index fbc587d3df5745c863387d4aa2e1e8a9c8bb7aad..bee3e3e7c7e4d99d08750fc92c556d98f5d27015 100644 (file)
 #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)
index 4da9468e1fd0157d3b1da2582feb60520158f792..871104bda049c20408567287b6770a4bc2c25c92 100644 (file)
@@ -11,6 +11,7 @@
 
 #ifdef __NR_mkdirat
 _syscall3(int, mkdirat, int, fd, const char *, path, mode_t, mode)
+libc_hidden_def(mkdirat)
 #else
 /* should add emulation with mkdir() and /proc/self/fd/ ... */
 #endif
This page took 0.032197 seconds and 4 git commands to generate.