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.
54 For an explanation of the terms used in this section, see
60 Interface Attribute Value
66 T} Thread safety MT-Safe
70 Some other systems have an
71 .\" e.g., FreeBSD 6.1.
82 Using this function to check a process's permissions on a file before
83 performing some operation based on that information leads to race conditions:
84 the file permissions may change between the two steps.
85 Generally, it is safer just to attempt the desired operation and handle
86 any permission error that occurs.
88 This function always dereferences symbolic links.
89 If you need to check the permissions on a symbolic link, use
94 .BR AT_SYMLINK_NOFOLLOW .
105 .BR path_resolution (7)