-
Notifications
You must be signed in to change notification settings - Fork 161
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
Add a rustix::fs::STATX_ATTR_MOUNT_ROOT
constant.
#1198
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,12 @@ pub(crate) use linux_raw_sys::general::epoll_event; | |
) | ||
) | ||
))] | ||
#[cfg(any(target_env = "musl", target_env = "gnu"))] | ||
pub(crate) use linux_raw_sys::general::{ | ||
AT_FDCWD, NFS_SUPER_MAGIC, O_LARGEFILE, PROC_SUPER_MAGIC, STATX_ATTR_MOUNT_ROOT, UTIME_NOW, | ||
UTIME_OMIT, XATTR_CREATE, XATTR_REPLACE, | ||
}; | ||
#[cfg(not(any(target_env = "musl", target_env = "gnu")))] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The src/backend/linux_raw directory doesn't use libc bindings for most things, so we should be able to just add |
||
pub(crate) use linux_raw_sys::general::{ | ||
AT_FDCWD, NFS_SUPER_MAGIC, O_LARGEFILE, PROC_SUPER_MAGIC, UTIME_NOW, UTIME_OMIT, XATTR_CREATE, | ||
XATTR_REPLACE, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,6 +116,8 @@ pub use sendfile::sendfile; | |
pub use special::*; | ||
#[cfg(linux_kernel)] | ||
pub use statx::statx; | ||
#[cfg(all(linux_kernel, any(target_env = "musl", target_env = "gnu")))] | ||
pub use statx::STATX_ATTR_MOUNT_ROOT; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One thing we can do to make this code a little tidier is just change the |
||
#[cfg(not(any( | ||
target_os = "espidf", | ||
target_os = "redox", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,11 @@ use backend::fs::syscalls::statx as _statx; | |
#[cfg(not(feature = "linux_4_11"))] | ||
use compat::statx as _statx; | ||
|
||
/// `STATX_ATTR_MOUNT_ROOT`—Address of the root of a mount | ||
#[allow(dead_code)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a |
||
#[cfg(all(linux_kernel, any(target_env = "musl", target_env = "gnu")))] | ||
pub const STATX_ATTR_MOUNT_ROOT: u32 = backend::c::STATX_ATTR_MOUNT_ROOT as u32; | ||
|
||
/// `statx(dirfd, path, flags, mask, statxbuf)` | ||
/// | ||
/// This function returns [`io::Errno::NOSYS`] if `statx` is not available on | ||
|
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 module does
use libc::*
at the top, so this line is unnecessary.