[RFC PATCH 02/38] access: prefer faccessat syscall

Jonas Bonn jonas at southpole.se
Tue Sep 6 08:30:26 UTC 2011


Signed-off-by: Jonas Bonn <jonas at southpole.se>
---
 libc/sysdeps/linux/common/access.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/libc/sysdeps/linux/common/access.c b/libc/sysdeps/linux/common/access.c
index a075d42..9b9625c 100644
--- a/libc/sysdeps/linux/common/access.c
+++ b/libc/sysdeps/linux/common/access.c
@@ -8,5 +8,14 @@
  */
 
 #include <sys/syscall.h>
+#include <fcntl.h>
 #include <unistd.h>
+
+#ifdef __NR_faccessat
+int access(const char *pathname, int mode)
+{
+	return faccessat(AT_FDCWD, pathname, mode, 0);
+}
+#else
 _syscall2(int, access, const char *, pathname, int, mode)
+#endif
-- 
1.7.5.4



More information about the uClibc mailing list