Skip to content

v0.2.0

@lu-zero lu-zero tagged this 22 Aug 21:46
Breaking:
- wait4() now takes self by value instead of &mut self, fixing the
  double-wait/PID-recycle hole (#3). It reaps the child, so it can't
  be called (or wait() called) again on the same Child.

Added:
- try_wait4(&mut self) -> io::Result<Option<ResUse>>: non-blocking
  counterpart to wait4(), WNOHANG on Unix. Leaves stdin open, unlike
  wait4(). Once it returns Ok(Some(_)) the same reuse restriction as
  wait4() applies (also covers Child::kill).
- try_wait4_pid(pid) on Unix: non-blocking wait4 by raw pid, for
  callers whose child isn't a std::process::Child (e.g. tokio).
- Native wait4(2) fast path now covers the whole apple family
  (macOS/iOS/tvOS/watchOS), the whole linux_like family
  (Linux/Android), and the whole BSD family (FreeBSD/DragonFly/
  NetBSD/OpenBSD), not just macos/linux/freebsd.
- ResourceUsage/ResUse now derive Copy.

Changed:
- cfg-if dependency dropped in favor of std::cfg_select! (MSRV 1.95).
- winapi dependency replaced with windows-sys.
- edition 2024.

Fixed:
- EINTR retry loop around wait4(2) (previously a signal could cause a
  spurious error).
- getrusage(RUSAGE_CHILDREN) fallback (non-wait4(2) Unix targets) now
  checks getrusage's return value and uses an overflow-safe KiB->bytes
  conversion.

See README.md for the full upgrade notes and API documentation.
Assets 2
Loading