Open a directory readable, and on EACCES retry with O_PATH or O_SEARCH,
which anchor *at calls without read access. The targets with either flag
are named by the has_o_path and has_o_search cfg aliases. If the retry
fails, its own error is returned.
Deleting filtered bytes with a branch per byte, which mispredicts on
real data. Store every byte in a small block and only advance past the
kept ones. After a block that kept almost nothing, go back to the
branch: it is then well predicted and stores less. When the single
byte to delete is rare, copy the runs between its occurrences instead.
Add a benchmark for deleting a single byte.
Mean of 40 runs in ms, 100 MB input unless noted (Ryzen 9 9950X,
GNU 9.12, pinned core, hyperfine -N):
GNU trunk opti
tr -d , (CSV) 90.1 87.0 33.7
tr -d ' ' 118.0 109.2 33.8
tr -d '\n' 47.8 57.8 37.0
tr -d '\r' (CRLF, 16 MB) 7.4 8.9 5.7
tr -d aeiou 272.4 261.0 32.9
tr -cd 'a-z\n' 130.5 137.9 32.9
tr -cd '[:print:]' (binary) 332.0 317.6 35.0
Replace the onig C-dependency in expr with the pure-Rust fancy-regex crate.
This removes the onig_sys C library dependency while preserving full POSIX BRE,
backreference, multibyte UTF-8, and C locale compatibility.
Fixes required to build uutils/coreutils on HarmonyOS (aarch64-unknown-linux-ohos):
- uucore/fsext: statfs.f_type is u64 on OHOS; route it through the musl branch.
- hostid: implement gethostid locally (read /etc/hostid, else hash hostname)
because the OHOS SDK libc dropped the symbol.
- date: pass through the system time zone ID from OH_TimeService_GetTimeZone
and resolve it with embedded IANA tzdata (jiff-tzdb) via TimeZone::tzif,
instead of relying on /etc/localtime or a POSIX-injected TZ. The OHOS-only
helper is cfg-gated; non-OHOS code paths are byte-identical to upstream.
utmpx is intentionally left untouched: upstream #14252 disables it on OHOS
(no utmp data source there), and this PR defers to that approach.
Also syncs fuzz/Cargo.lock after adding the jiff-tzdb dependency.
Verified on-device: date matches system time (+0800 CST; 1987-06-01 -> +0900 CDT),
hostid behaves, builds pass on the non-utmpx feature set.