Why is there no O_SEARCH flag for an open function in Open Open?

Let's say I need to get a file descriptor for a file (or directory) that has only permission to execute (or search).

The X / Open norm defines the O_SEARCH flag for the open () function. See http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html

However, Linux does not work. There are only 3 flags available (O_RDONLY, O_WRONLY and O_RDWR). See http://man7.org/linux/man-pages/man2/open.2.html

Why? And how can I get a fd directory with a single permission to search?

thank

+4
source share
2 answers

, Linux , , . . " UNIX", Google

POSIX, C ( glibc, man 3 ), Linux ( , man 2 open).

1: GNU Linux, Linux, , Linux ( fcntl-linux.h fcntl.h).

EDIT 2: - https://sourceware.org/bugzilla/show_bug.cgi?id=18228

, , !

+3

open(3) ( 3P man-, ), . ArchLinux, 2017-05-24.

EDIT 1: , , , althoug .

, opendir, readdir , .


? fd ?

, , , fopen .

0

Source: https://habr.com/ru/post/1677854/


All Articles