about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorTobias Bucher <tobiasbucher5991@gmail.com>2024-04-27 18:36:29 +0200
committerTobias Bucher <tobiasbucher5991@gmail.com>2024-04-27 18:36:29 +0200
commitadebad1dce19299c3c4f59d9f93d82af16abdfa9 (patch)
treef19ed4682acfb74d34979001eb0d8f8107090bc9 /library/std
parent61a1dbd751ab7f3c973be17d7ff3948ffda07c6e (diff)
downloadrust-adebad1dce19299c3c4f59d9f93d82af16abdfa9.tar.gz
rust-adebad1dce19299c3c4f59d9f93d82af16abdfa9.zip
Elaborate in comment about `statx` probe
As requested by @workingjubilee in
https://github.com/rust-lang/rust/pull/123928#discussion_r1564916743.
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/sys/pal/unix/fs.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs
index 3456155509e..c37332ac6b1 100644
--- a/library/std/src/sys/pal/unix/fs.rs
+++ b/library/std/src/sys/pal/unix/fs.rs
@@ -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()