Soo, what's the better invocation: open("foo", O_RDONLY|O_DIRECTORY) or just open("foo", O_DIRECTORY)? I mean, both appear to work, but I think one of them feels more correct, but what do you think?
-
-
Replying to @pid_eins
if you're not using O_PATH (e.g. because you want to use getdents), then IMO you should definitely be writing O_RDONLY|O_DIRECTORY. O_DIRECTORY is just an additional flag that says "fail if it's not a directory"; and the kernel does check whether you're trying to open for writing
1 reply 0 retweets 1 like -
also note that O_RDONLY is 0, so technically you can always leave out O_RDONLY :P
1 reply 0 retweets 6 likes
see http://man7.org/linux/man-pages/man2/open.2.html … , section "File access mode"
1:41 PM - 7 Jan 2019
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.