summaryrefslogtreecommitdiff
path: root/doc/posix-functions/access.texi
blob: 8bfa2c1a67bf798a381a2b766cadf2104b5dfabc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@node access
@section @code{access}
@findex access

POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html}

Gnulib module: access

Portability problems fixed by Gnulib:
@itemize
@item
This function does not support the @code{X_OK} mode on some platforms:
MSVC 14.
@end itemize

Portability problems not fixed by Gnulib:
@itemize
@item
This function uses the effective id instead of the real id on some
platforms:
Cygwin 1.5.x.
@end itemize

Other problems of this function:
@itemize
@item
There is an inherent race between calling this function and performing
some action based on the results; you should think twice before trusting
this function, especially in a set-uid or set-gid program.
@item
This function does not have an option for not following symbolic links
(like @code{stat} versus @code{lstat}).  If you need this option, use
the Gnulib module @code{faccessat} with the @code{AT_EACCESS} flag.
@item
On native Windows, files whose basename does not contain a @samp{.}
cannot be executed through @code{execlp} or @code{execvp}.  Nevertheless,
this function may return true for such files.
@item
On Windows, different facilities for executing a program have different
ways of finding an executable file, by trying various suffixes.  For
example, @code{execlp} and @code{execvp} search for files with the
suffixes @code{.com}, @code{.exe}, @code{.bat}, @code{.cmd}, when the
file with the given file name does not exist.  Whereas @code{cmd.exe}
searches according to the @code{PATHEXT} environment variable.  This
function does not perform any search; it merely looks at the file with
the given file name.
@end itemize