poll tests: Avoid test failure on BSD and Solaris systems.
[gnulib.git] / doc / posix-functions / access.texi
blob8bfa2c1a67bf798a381a2b766cadf2104b5dfabc
1 @node access
2 @section @code{access}
3 @findex access
5 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html}
7 Gnulib module: access
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 This function does not support the @code{X_OK} mode on some platforms:
13 MSVC 14.
14 @end itemize
16 Portability problems not fixed by Gnulib:
17 @itemize
18 @item
19 This function uses the effective id instead of the real id on some
20 platforms:
21 Cygwin 1.5.x.
22 @end itemize
24 Other problems of this function:
25 @itemize
26 @item
27 There is an inherent race between calling this function and performing
28 some action based on the results; you should think twice before trusting
29 this function, especially in a set-uid or set-gid program.
30 @item
31 This function does not have an option for not following symbolic links
32 (like @code{stat} versus @code{lstat}).  If you need this option, use
33 the Gnulib module @code{faccessat} with the @code{AT_EACCESS} flag.
34 @item
35 On native Windows, files whose basename does not contain a @samp{.}
36 cannot be executed through @code{execlp} or @code{execvp}.  Nevertheless,
37 this function may return true for such files.
38 @item
39 On Windows, different facilities for executing a program have different
40 ways of finding an executable file, by trying various suffixes.  For
41 example, @code{execlp} and @code{execvp} search for files with the
42 suffixes @code{.com}, @code{.exe}, @code{.bat}, @code{.cmd}, when the
43 file with the given file name does not exist.  Whereas @code{cmd.exe}
44 searches according to the @code{PATHEXT} environment variable.  This
45 function does not perform any search; it merely looks at the file with
46 the given file name.
47 @end itemize