diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2012-10-10 15:10:27 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2013-02-20 13:45:11 +0100 |
commit | ecb2be2c0a2f9c489663a4b01b97074dda2ceb1e (patch) | |
tree | 4f9c1c406d87d92c2d3c482e76b9f444e5048401 /libc/sysdeps/linux/common/mkdir.c | |
parent | d8386ad5e72b0e0583cc233d476c5b50ca66a4e5 (diff) |
mkdir: Use mkdirat if arch does not have the mkdir syscall
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/common/mkdir.c')
-rw-r--r-- | libc/sysdeps/linux/common/mkdir.c | 10 |
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) |