Files
Chris Hayduk bb8f5304fc Fall back when macOS rejects high stdio descriptors (#55278)
## Why

On macOS, spawn file actions reject valid descriptors at or above `OPEN_MAX` even when `RLIMIT_NOFILE` permits them. This can prevent child processes from starting when their stdio descriptors exceed that limit.

## What changed

Use the compatibility backend when `posix_spawn_file_actions_adddup2` returns `EBADF` for stdio setup and `SpawnFallback::Compatible` is enabled. Preserve the error for `SpawnFallback::ReturnError`.

## Testing

Add a macOS regression test that forces high stdio descriptors and checks strict-mode errors, fallback stdio and exit status, process groups, and descriptor isolation without changing the parent's descriptor.

GitOrigin-RevId: b2a65a53403035df97831393a4f0eb77107b996e
2026-10-19 13:10:35 +00:00
..