1
Fork 0
rust/library/std/src/sys/unix
Dylan DPC 3e1e9b4866
Rollup merge of #94446 - rusticstuff:remove_dir_all-illumos-fix, r=cuviper
UNIX `remove_dir_all()`: Try recursing first on the slow path

This only affects the _slow_ code path - if there is no `dirent.d_type` or if it is `DT_UNKNOWN`.

POSIX specifies that calling `unlink()` or `unlinkat(..., 0)` on a directory is allowed to succeed:
> The _path_ argument shall not name a directory unless the process has appropriate privileges and the implementation supports using _unlink()_ on directories.

This however can cause dangling inodes requiring an fsck e.g. on Illumos UFS, so we have to avoid that in the common case. We now just try to recurse into it first and unlink() if we can't open it as a directory.

The other two commits integrate the Macos x86-64 implementation reducing redundancy. Split into two commits for better reviewing.

Fixes #94335.
2022-03-05 04:46:37 +01:00
..
fd I/O safety. 2021-08-19 12:02:39 -07:00
kernel_copy add test for failing io::copy specialization 2021-02-22 21:41:32 +01:00
os Refactor weak symbols in std::sys::unix 2021-11-12 15:25:16 -08:00
os_str Move os_str_bytes to sys::unix and reuse it on other platforms. 2021-07-03 03:01:36 +02:00
process Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
alloc.rs STD support for the ESP-IDF framework 2021-08-10 12:09:00 +03:00
android.rs Refactor weak symbols in std::sys::unix 2021-11-12 15:25:16 -08:00
args.rs STD support for the ESP-IDF framework 2021-08-10 12:09:00 +03:00
cmath.rs Reuse unix::cmath 2021-04-28 14:25:04 +02:00
condvar.rs STD support for the ESP-IDF framework 2021-08-10 12:09:00 +03:00
env.rs STD support for the ESP-IDF framework 2021-08-10 12:09:00 +03:00
fd.rs Rollup merge of #88794 - sunfishcode:sunfishcode/try-clone, r=joshtriplett 2022-01-25 05:51:09 +01:00
fs.rs Integrate macos x86-64 remove_dir_all() impl. Step 2: readd 2022-03-04 13:47:50 +01:00
futex.rs Fix timeout conversion 2020-11-12 03:40:15 +00:00
io.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
kernel_copy.rs Fix a bunch of typos 2021-12-14 16:40:43 +01:00
l4re.rs Hide Repr details from io::Error, and rework io::Error::new_const. 2022-02-04 18:47:29 -08:00
memchr.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
mod.rs Rename to InvalidFilename 2022-02-10 23:49:27 +09:00
mutex.rs Check that pthread mutex initialization succeeded 2020-10-20 00:00:00 +00:00
net.rs Hide Repr details from io::Error, and rework io::Error::new_const. 2022-02-04 18:47:29 -08:00
os.rs solarish current_exe using libc call directly 2022-02-20 08:53:18 +00:00
os_str.rs Add try_reserve for OsString 2021-12-28 11:28:05 +08:00
path.rs Fix absolute issues 2022-02-08 14:57:35 +00:00
pipe.rs I/O safety. 2021-08-19 12:02:39 -07:00
rand.rs STD support for the ESP-IDF framework 2021-08-10 12:09:00 +03:00
rwlock.rs Multiple improvements to RwLocks 2021-06-01 09:07:55 +02:00
stack_overflow.rs Rollup merge of #89068 - bjorn3:restructure_rt2, r=joshtriplett 2021-10-31 13:20:04 +01:00
stdio.rs Rename BorrowedFd::borrow_raw_fd to BorrowedFd::borrow_raw. 2022-02-04 13:41:00 -08:00
thread.rs hardcode /sys/fs/cgroup instead of doing a lookup via mountinfo 2022-03-03 00:43:46 +01:00
thread_local_dtor.rs Move sys::vxworks code to sys::unix 2021-04-19 13:29:22 +02:00
thread_local_key.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
time.rs make Instant::{duration_since, elapsed, sub} saturating and remove workarounds 2022-02-13 01:04:55 +01:00
weak.rs Fix CVE-2022-21658 for UNIX-like 2022-01-19 15:59:22 +01:00