rust/library/std
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
..
benches
primitive_docs
src Rollup merge of #94446 - rusticstuff:remove_dir_all-illumos-fix, r=cuviper 2022-03-05 04:46:37 +01:00
tests Move is_aarch64_feature_detected! to simd_aarch64 feature and stabilise 2022-02-10 15:24:13 +00:00
build.rs
Cargo.toml removing architecture requirements for RustyHermit 2022-02-15 13:57:07 +01:00