]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/euidaccess.3
accept.2, execve.2, futimesat.2, getresuid.2, getrlimit.2, madvise.2, mq_getsetattr...
[thirdparty/man-pages.git] / man3 / euidaccess.3
CommitLineData
6ce8cde2
MK
1.\" Hey Emacs! This file is -*- nroff -*- source.
2.\"
c11b1abf 3.\" Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
6ce8cde2
MK
4.\"
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.
8.\"
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.
13.\"
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
20.\" professionally.
21.\"
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
24.\"
25.\"
cc4615cc 26.TH EUIDACCESS 3 2007-07-26 "" "Linux Programmer's Manual"
6ce8cde2
MK
27.SH NAME
28euidaccess, eaccess \- check effective user's permissions for a file
29.SH SYNOPSIS
30.nf
cc4615cc 31.B #define _GNU_SOURCE
6ce8cde2
MK
32.B #include <unistd.h>
33.sp
34.BI "int euidaccess(const char *" pathname ", int " mode );
35.BI "int eaccess(const char *" pathname ", int " mode );
36.fi
37.SH DESCRIPTION
38Like
fb186734 39.BR access (2),
6ce8cde2
MK
40.BR euidaccess ()
41checks permissions and existence of the file identified by its argument
42.IR pathname .
988db661 43However, whereas
fb186734 44.BR access (2),
6ce8cde2
MK
45performs checks using the real user and group identifiers of the process,
46.BR euidaccess ()
47uses the effective identifiers.
48
49.I mode
50is a mask consisting of one or more of
51.BR R_OK ", " W_OK ", " X_OK " and " F_OK ,
988db661 52with the same meanings as for
fb186734 53.BR access (2).
6ce8cde2
MK
54
55.BR eaccess ()
56is a synonym for
57.BR euidaccess (),
58provided for compatibility with some other systems.
59.SH "RETURN VALUE"
60On success (all requested permissions granted), zero is returned.
61On error (at least one bit in
62.I mode
63asked for a permission that is denied, or some other error occurred),
64\-1 is returned, and
65.I errno
66is set appropriately.
67.SH ERRORS
68As for
fb186734 69.BR access (2).
3b0ac71f
MK
70.SH VERSIONS
71The
72.BR eaccess ()
73function was added to glibc in version 2.4.
6ce8cde2 74.SH "CONFORMING TO"
c8f2dd47 75These functions are nonstandard.
6ce8cde2
MK
76Some other systems have an
77.\" e.g., FreeBSD 6.1.
78.BR eaccess ()
79function.
6ce8cde2
MK
80.SH "SEE ALSO"
81.BR access (2),
6ce8cde2
MK
82.BR chmod (2),
83.BR chown (2),
6ce8cde2
MK
84.BR faccessat (2),
85.BR open (2),
6ce8cde2
MK
86.BR setgid (2),
87.BR setuid (2),
ad7cc990 88.BR stat (2),
53a1443c 89.BR credentials (7),
ad7cc990 90.BR path_resolution (7)