OSDN Git Service

access: Use faccessat if arch does not have the access syscall
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / common / access.c
1 /* vi: set sw=4 ts=4: */
2 /*
3  * access() for uClibc
4  *
5  * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
6  *
7  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
8  */
9
10 #include <sys/syscall.h>
11 #include <unistd.h>
12
13 #if defined __NR_faccessat && !defined __NR_access
14 # include <fcntl.h>
15 int access(const char *pathname, int mode)
16 {
17         return faccessat(AT_FDCWD, pathname, mode, 0);
18 }
19
20 #else
21 _syscall2(int, access, const char *, pathname, int, mode)
22 #endif