fcntl-h: default O_SEARCH, O_EXEC to O_PATH if available
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 5 Nov 2012 21:53:36 +0000 (13:53 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 5 Nov 2012 21:54:38 +0000 (13:54 -0800)
commite99cec677e1bf25595c6b65992c0228160508f8b
tree3f757d8e72993e40b8d9278b1389d71dc20cc170
parent613bcb6205cf2b64d835c19074c5a7e7c6cb99eb
fcntl-h: default O_SEARCH, O_EXEC to O_PATH if available

Linux kernel 2.6.39 introduced O_PATH (see
<http://lwn.net/Articles/433854/>) and this is a better fallback
for O_SEARCH and O_EXEC than O_RDONLY, if O_PATH is available.
* doc/posix-headers/fcntl.texi (fcntl.h): Document this.
* lib/fcntl.in.h (O_EXEC, O_SEARCH) [O_PATH]: Default to O_PATH.
* lib/fcntl.in.h (O_ACCMODE):
* tests/test-fcntl-h.c (main):
Do not reject O_ACCMODE merely because it has more than the
minimal number of bits, as POSIX allows extensions here.
ChangeLog
doc/posix-headers/fcntl.texi
lib/fcntl.in.h
tests/test-fcntl-h.c