SIGN IN SIGN UP

Fix building where posix_spawn_file_actions_addchdir_np is unavailable (#104)

* Fix building against glibc older than 2.29

posix_spawn_file_actions_addchdir_np arrived in glibc 2.29, so
subprocess_create_ex fails to compile and link on older systems such as
manylinux2014. Add a SUBPROCESS_HAVE_CWD probe, report a requested cwd
as ENOSYS where the call is unavailable, and skip the cwd test there.

* Allow overriding SUBPROCESS_HAVE_CWD and document it

musl gained posix_spawn_file_actions_addchdir_np in 1.1.24 but exposes no
version macro, so the detection cannot cover older releases. Skip it when the
macro is already defined, letting those users set it themselves.

* Fix building against macOS older than 10.15

posix_spawn_file_actions_addchdir_np arrived in macOS 10.15, so older SDKs
neither declare nor export it and subprocess_create_ex fails to compile, as
reported for MacPorts on PowerPC in #108. A newer SDK paired with an older
deployment target does compile, but warns and leaves the binary referencing
a symbol the target system does not have.

Extend the SUBPROCESS_HAVE_CWD probe with a Darwin arm. It deliberately omits
a defined() guard on MAC_OS_X_VERSION_MIN_REQUIRED: an absent macro folds to
0, so a toolchain that does not supply it answers "no cwd" rather than
calling a function that may not be there. That also gives the right answer on
iOS, tvOS and watchOS, where the SDKs mark the call unavailable outright.
B
Bernard Ladenthin committed
e3293589eeb66a9a7333efe082e09d6d75f778b2
Parent: 8671cee
Committed by GitHub <noreply@github.com> on 8/9/2026, 10:07:50 AM