Skip to content

Commit dd215a8

Browse files
committed
Elaborate in comment about statx probe
As requested by @workingjubilee in rust-lang#123928 (comment).
1 parent e43ff27 commit dd215a8

File tree

1 file changed

+4
-8
lines changed
  • std/src/sys/pal/unix

1 file changed

+4
-8
lines changed

Diff for: std/src/sys/pal/unix/fs.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -198,20 +198,16 @@ cfg_has_statx! {{
198198
return Some(Err(err));
199199
}
200200

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

0 commit comments

Comments
 (0)