summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/mknod.c
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2012-10-10 14:53:41 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-02-20 13:45:11 +0100
commit6589e886e031a810b9c2ad773e9d8cc7fd5a0725 (patch)
treefea5aa4d66bebce009a8975c2d35f3f83311f0d6 /libc/sysdeps/linux/common/mknod.c
parent09a387a0fcedce4270f62f5ea75c7bb0374c4d7f (diff)
mknod: Use mknodat if arch does not have the mknod 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/mknod.c')
-rw-r--r--libc/sysdeps/linux/common/mknod.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/mknod.c b/libc/sysdeps/linux/common/mknod.c
index b52c8c55c..416cab6d0 100644
--- a/libc/sysdeps/linux/common/mknod.c
+++ b/libc/sysdeps/linux/common/mknod.c
@@ -10,6 +10,13 @@
#include <sys/syscall.h>
#include <sys/stat.h>
+#if defined __NR_mknodat && !defined __NR_mknod
+# include <fcntl.h>
+int mknod(const char *path, mode_t mode, dev_t dev)
+{
+ return mknodat(AT_FDCWD, path, mode, dev);
+}
+#else
int mknod(const char *path, mode_t mode, dev_t dev)
{
unsigned long long int k_dev;
@@ -19,4 +26,5 @@ int mknod(const char *path, mode_t mode, dev_t dev)
return INLINE_SYSCALL(mknod, 3, path, mode, (unsigned int)k_dev);
}
+#endif
libc_hidden_def(mknod)