I'm trying to use O_DIRECTORY with open(2).
It says, if pathname is not a directory, cause the open to fail.
jnr-posix does not seem to fail when opening a file with O_DIRECTORY.
Both fd1 and fd2 are non-negative integers. I would expect fd2 to be a negative indicating that the open failed. I see the correct behavior when using c directly.
Problem:
I'm trying to use
O_DIRECTORY
with open(2). It says, if pathname is not a directory, cause the open to fail. jnr-posix does not seem to fail when opening a file with O_DIRECTORY.Example:
Both fd1 and fd2 are non-negative integers. I would expect fd2 to be a negative indicating that the open failed. I see the correct behavior when using c directly.
I have also tried using:
Is this a bug?