1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
26 .TH EUIDACCESS 3 2010-11-01 "" "Linux Programmer's Manual"
28 euidaccess, eaccess \- check effective user's permissions for a file
31 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
32 .B #include <unistd.h>
34 .BI "int euidaccess(const char *" pathname ", int " mode );
35 .BI "int eaccess(const char *" pathname ", int " mode );
41 checks permissions and existence of the file identified by its argument
45 performs checks using the real user and group identifiers of the process,
47 uses the effective identifiers.
50 is a mask consisting of one or more of
51 .BR R_OK ", " W_OK ", " X_OK " and " F_OK ,
52 with the same meanings as for
58 provided for compatibility with some other systems.
60 On success (all requested permissions granted), zero is returned.
61 On error (at least one bit in
63 asked for a permission that is denied, or some other error occurred),
73 function was added to glibc in version 2.4.
75 These functions are nonstandard.
76 Some other systems have an
77 .\" 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)