Skip to content
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

Elaborate in comment about statx probe #124443

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions library/std/src/sys/pal/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,16 @@ cfg_has_statx! {{
return Some(Err(err));
}

// `ENOSYS` might come from a faulty FUSE driver.
//
// Other errors are not a good enough indicator either -- it is
// known that `EPERM` can be returned as a result of using seccomp to
// block the syscall.
// We're not yet entirely sure whether `statx` is usable on this kernel
// or not. Syscalls can return errors from things other than the kernel
// per se, e.g. `EPERM` can be returned if seccomp is used to block the
// syscall, or `ENOSYS` might be returned from a faulty FUSE driver.
//
// Availability is checked by performing a call which expects `EFAULT`
// if the syscall is usable.
//
// See: https://github.com/rust-lang/rust/issues/65662
//
// FIXME this can probably just do the call if `EPERM` was received, but
// previous iteration of the code checked it for all errors and for now
// this is retained.
// FIXME what about transient conditions like `ENOMEM`?
let err2 = cvt(statx(0, ptr::null(), 0, libc::STATX_ALL, ptr::null_mut()))
.err()
Expand Down
Loading