summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/access.c
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2012-10-10 13:44:07 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-02-20 13:45:11 +0100
commit695e274cf7f24c596258827ee202d29ff735d9b9 (patch)
treee0c02d79f717410f92dee3a5760658c499aeb0e0 /libc/sysdeps/linux/common/access.c
parent82cab378652c1d1601545a80b7241090c55b1e37 (diff)
access: Use faccessat if arch does not have the access 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/access.c')
-rw-r--r--libc/sysdeps/linux/common/access.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/access.c b/libc/sysdeps/linux/common/access.c
index a075d421a..139b7b76b 100644
--- a/libc/sysdeps/linux/common/access.c
+++ b/libc/sysdeps/linux/common/access.c
@@ -9,4 +9,14 @@
#include <sys/syscall.h>
#include <unistd.h>
+
+#if defined __NR_faccessat && !defined __NR_access
+# include <fcntl.h>
+int access(const char *pathname, int mode)
+{
+ return faccessat(AT_FDCWD, pathname, mode, 0);
+}
+
+#else
_syscall2(int, access, const char *, pathname, int, mode)
+#endif