access(2) System Calls Manual access(2) access, faccessat, faccessat2 - (libc -lc) #include int access(const char *path, int mode); #include /* Definition of AT_* constants */ #include int faccessat(int dirfd, const char *path, int mode, int flags); /* But see C library/kernel differences, below */ #include /* Definition of AT_* constants */ #include /* Definition of SYS_* constants */ #include int syscall(SYS_faccessat2, int dirfd, const char *path, int mode, int flags); glibc ( feature_test_macros(7)): faccessat(): glibc 2.10: _POSIX_C_SOURCE >= 200809L glibc 2.10: _ATFILE_SOURCE access() path. path . mode () F_OK OR R_OK W_OK X_OK. F_OK . R_OK W_OK X_OK . UID GID ( open(2)) . . set-user-ID . access() " // ". : "( setuid) // " set-user-ID . ( UID ) X_OK . faccessat() faccessat() access() . path dirfd ( access() ). path dirfd AT_FDCWD path ( access()). path dirfd. flags OR : AT_EACCESS . faccessat() ( access()). AT_EMPTY_PATH ( 5.8) path dirfd ( O_PATH open(2)). dirfd . dirfd AT_FDCWD . _GNU_SOURCE . AT_SYMLINK_NOFOLLOW path : . openat(2) faccessat(). faccessat2() faccessat() POSIX.1 glibc. glibc ( ) faccessat() Linux flags. Linux 5.8 faccessat2() flags faccessat(). ( mode F_OK ) . ( mode mode F_OK ) -1 errno . EACCES path. ( path_resolution(7).) EBADF (faccessat()) path dirfd AT_FDCWD (faccessat()) . EFAULT path . EINVAL mode . EINVAL (faccessat()) flags. EIO /. ELOOP path. ENAMETOOLONG path . ENOENT path . ENOMEM . ENOTDIR path . ENOTDIR (faccessat()) path dirfd . EPERM . FS_IOC_SETFLAGS(2const). EROFS . ETXTBSY . ( ) POSIX.1-2001 X_OK . . C faccessat() . AT_EACCESS AT_SYMLINK_NOFOLLOW glibc faccessat(). fstatat(2) . glibc faccessat() ( AT_EACCESS AT_SYMLINK_NOFOLLOW) glibc access(). path glibc /proc/self/fd dirfd. access() faccessat() POSIX.1-2024. faccessat2() . access() 4.3BSD SVr4 POSIX.1-1988. faccessat() 2.6.16 glibc 2.4 POSIX.1-2008. faccessat2() 5.8. : open(2) . . ( open(2).) access() . faccessat() AT_SYMLINK_NOFOLLOW. mode mode . path ( ). access() . . . DOS execve(2) . NFSv2 UID UID . ( NFS 3 .) FUSE. faccessat() flags glibc faccessat() glibc 2.32 faccessat() fstatat(2). (ACLs). glibc 2.33 faccessat2() . 2.4 ( ) X_OK . access() -1 mode X_OK R_OK W_OK mode access() 0 . 2.6 ( 2.6.3) 2.4. 2.6.20 MS_NOEXEC mount(2) . 2.6.20 MS_NOEXEC. chmod(2), chown(2), open(2), setgid(2), setuid(2), stat(2), euidaccess(3), credentials(7), path_resolution(7), symlink(7) 3 . . : . 6.18 8 2026 access(2)