Skip to content

Commit 22c9087

Browse files
committed
std: treat ENFILE as transient in the pidfd support probe
The probe handles EMFILE (per-process fd limit) as a transient error and re-probes later, but lets ENFILE (system-wide fd limit) fall through to the catch-all arm meant for an old kernel without pidfd support, which permanently caches the pidfd path as unsupported. ENFILE is the same transient condition, so handle both.
1 parent 267c405 commit 22c9087

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • library/std/src/sys/process/unix

library/std/src/sys/process/unix/unix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ impl Command {
510510
support = SPAWN;
511511
}
512512
}
513-
Err(e) if e.raw_os_error() == Some(libc::EMFILE) => {
513+
Err(e) if matches!(e.raw_os_error(), Some(libc::EMFILE | libc::ENFILE)) => {
514514
// We're temporarily(?) out of file descriptors. In this case pidfd_spawnp would also fail
515515
// Don't update the support flag so we can probe again later.
516516
return Err(e)

0 commit comments

Comments
 (0)