diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-10-19 22:00:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-19 22:00:58 +0200 |
| commit | d881cc67231ccb57a9b6bb0eb31b1ef2a25bb98d (patch) | |
| tree | 5cea543e1d56d3fb7b17c734383f23a07c82fb24 | |
| parent | 91e46844c8713c06d1e0f0cb61e25a982dd92152 (diff) | |
| parent | d84114690bc0241792e50e386250d8ebd48884f0 (diff) | |
| download | rust-d881cc67231ccb57a9b6bb0eb31b1ef2a25bb98d.tar.gz rust-d881cc67231ccb57a9b6bb0eb31b1ef2a25bb98d.zip | |
Rollup merge of #131921 - klensy:statx_all, r=ChrisDenton
replace STATX_ALL with (STATX_BASIC_STATS | STATX_BTIME) as former is deprecated STATX_ALL was deprecated in https://github.com/torvalds/linux/commit/581701b7efd60ba13d8a7eed60cbdd7fefaf6696 and suggested to use equivalent (STATX_BASIC_STATS | STATX_BTIME) combination, to prevent future surprises.
| -rw-r--r-- | library/std/src/sys/pal/unix/fs.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs index 567577b2b4d..f1f843a5f7a 100644 --- a/library/std/src/sys/pal/unix/fs.rs +++ b/library/std/src/sys/pal/unix/fs.rs @@ -189,7 +189,7 @@ cfg_has_statx! {{ // See: https://github.com/rust-lang/rust/issues/65662 // // FIXME what about transient conditions like `ENOMEM`? - let err2 = cvt(statx(0, ptr::null(), 0, libc::STATX_ALL, ptr::null_mut())) + let err2 = cvt(statx(0, ptr::null(), 0, libc::STATX_BASIC_STATS | libc::STATX_BTIME, ptr::null_mut())) .err() .and_then(|e| e.raw_os_error()); if err2 == Some(libc::EFAULT) { @@ -910,7 +910,7 @@ impl DirEntry { fd, name, libc::AT_SYMLINK_NOFOLLOW | libc::AT_STATX_SYNC_AS_STAT, - libc::STATX_ALL, + libc::STATX_BASIC_STATS | libc::STATX_BTIME, ) } { return ret; } @@ -1194,7 +1194,7 @@ impl File { fd, c"".as_ptr() as *const c_char, libc::AT_EMPTY_PATH | libc::AT_STATX_SYNC_AS_STAT, - libc::STATX_ALL, + libc::STATX_BASIC_STATS | libc::STATX_BTIME, ) } { return ret; } @@ -1767,7 +1767,7 @@ pub fn stat(p: &Path) -> io::Result<FileAttr> { libc::AT_FDCWD, p.as_ptr(), libc::AT_STATX_SYNC_AS_STAT, - libc::STATX_ALL, + libc::STATX_BASIC_STATS | libc::STATX_BTIME, ) } { return ret; } @@ -1786,7 +1786,7 @@ pub fn lstat(p: &Path) -> io::Result<FileAttr> { libc::AT_FDCWD, p.as_ptr(), libc::AT_SYMLINK_NOFOLLOW | libc::AT_STATX_SYNC_AS_STAT, - libc::STATX_ALL, + libc::STATX_BASIC_STATS | libc::STATX_BTIME, ) } { return ret; } |
