2 .\" Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .TH euidaccess 3 (date) "Linux man-pages (unreleased)"
8 euidaccess, eaccess \- check effective user's permissions for a file
11 .RI ( libc ", " \-lc )
14 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
15 .B #include <unistd.h>
17 .BI "int euidaccess(const char *" pathname ", int " mode );
18 .BI "int eaccess(const char *" pathname ", int " mode );
24 checks permissions and existence of the file identified by its argument
28 performs checks using the real user and group identifiers of the process,
30 uses the effective identifiers.
33 is a mask consisting of one or more of
34 .BR R_OK ", " W_OK ", " X_OK ", and " F_OK ,
35 with the same meanings as for
41 provided for compatibility with some other systems.
43 On success (all requested permissions granted), zero is returned.
44 On error (at least one bit in
46 asked for a permission that is denied, or some other error occurred),
49 is set to indicate the error.
56 function was added in glibc 2.4.
58 For an explanation of the terms used in this section, see
66 Interface Attribute Value
70 T} Thread safety MT-Safe
76 These functions are nonstandard.
77 Some other systems have an
78 .\" e.g., FreeBSD 6.1.
83 Using this function to check a process's permissions on a file before
84 performing some operation based on that information leads to race conditions:
85 the file permissions may change between the two steps.
86 Generally, it is safer just to attempt the desired operation and handle
87 any permission error that occurs.
89 This function always dereferences symbolic links.
90 If you need to check the permissions on a symbolic link, use
95 .BR AT_SYMLINK_NOFOLLOW .
106 .BR path_resolution (7)