From 695e274cf7f24c596258827ee202d29ff735d9b9 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 10 Oct 2012 13:44:07 +0100 Subject: access: Use faccessat if arch does not have the access syscall Signed-off-by: Markos Chandras Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/access.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libc/sysdeps/linux/common/access.c') 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 #include + +#if defined __NR_faccessat && !defined __NR_access +# include +int access(const char *pathname, int mode) +{ + return faccessat(AT_FDCWD, pathname, mode, 0); +} + +#else _syscall2(int, access, const char *, pathname, int, mode) +#endif -- cgit v1.2.3