We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openat(dirfd: RawFd, ...)
openat(dirfd: Option<RawFd>, ...)
Almost every xxxat() function takes an optional dirfd, except fcntl::openat(2) and Dir::openat()
xxxat()
dirfd
fcntl::openat(2)
Dir::openat()
pub fn openat<P: ?Sized + NixPath>( dirfd: RawFd, path: &P, oflag: OFlag, mode: Mode, ) -> Result<RawFd>
pub fn openat<P: ?Sized + NixPath>(dirfd: RawFd, path: &P, oflag: OFlag, mode: sys::stat::Mode) -> Result<Self> { let fd = fcntl::openat(dirfd, path, oflag, mode)?; Dir::from_fd(fd) }
Any reason why it does not take an Option<RawFd>?
Option<RawFd>
The text was updated successfully, but these errors were encountered:
We should just do something similar to https://docs.rs/rustix/latest/src/rustix/fs/cwd.rs.html#26-32 (but as a const) while implementing #1750.
Sorry, something went wrong.
Git archaeology doesn't show any good reason why the functions take a RawFd. I agree that an Option would be better.
RawFd
Close as completed in #2139
Successfully merging a pull request may close this issue.
Almost every
xxxat()
function takes an optionaldirfd
, exceptfcntl::openat(2)
andDir::openat()
Any reason why it does not take an
Option<RawFd>
?The text was updated successfully, but these errors were encountered: