-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
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
feat: AT_EMPTY_PATH for fchownat on Linux/Android/FreeBSD/Hurd #2267
Conversation
src/unistd.rs
Outdated
NoFollowSymlink, | ||
libc_bitflags! { | ||
/// Flags for the `fchownat` function. | ||
pub struct FchownatFlags: c_int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're already using AtFlags for more than one function, I think we can use it here, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a rare case of an API change in Nix where we can help users migrate. What about defining some deprecated constants like this?
impl FchownatFlags {
#[deprecated]
pub const FollowSymlink = FchownatFlags::empty();
#[deprecated]
pub const NoFollowSymlink = FchownatFlags::AT_SYMLINK_NOFOLLOW;
}
src/unistd.rs
Outdated
NoFollowSymlink, | ||
libc_bitflags! { | ||
/// Flags for the `fchownat` function. | ||
pub struct FchownatFlags: c_int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're already using AtFlags for more than one function, I think we can use it here, too.
src/unistd.rs
Outdated
/// | ||
/// If `dirfd` is `None`, the call operates on the current working | ||
/// directory. | ||
#[cfg(linux_android)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also available on FreeBSD, beginning in 13.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me do this in a separate PR
Done Well, fixing imports is so painful, I really hope Nix never do
but directly use the items when needed. |
a8bae50
to
327e7df
Compare
What does this PR do
Picks up #1128
Closes #1128 Closes #1029
Enable the
AT_EMPTY_PATH
flag forfchownat()
on Linux/Android/FreeBSD/HurdChecklist:
CONTRIBUTING.md