@@ -79,11 +79,12 @@ int pthread_fchdir_np(int fd)
7979// Implementation mostly copied from _CFPosixSpawnFileActionsChdir in swift-corelibs-foundation
8080static int posix_spawn_file_actions_addchdir_polyfill (posix_spawn_file_actions_t * __restrict file_actions,
8181 const char * __restrict path) {
82- #if (defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29)) || (defined(__OpenBSD__)) || (defined(__ANDROID__) && __ANDROID_API__ < 34)
82+ #if (defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29)) || (defined(__OpenBSD__)) || (defined(__ANDROID__) && __ANDROID_API__ < 34) || (defined(__QNX__))
8383 // Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
8484 // - Amazon Linux 2 (EoL mid-2025)
8585 // Currently missing as of:
8686 // - OpenBSD 7.5 (April 2024)
87+ // - QNX 8 (December 2023)
8788 // - Android <= 14
8889 return ENOSYS;
8990#elif defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500
@@ -92,7 +93,7 @@ static int posix_spawn_file_actions_addchdir_polyfill(posix_spawn_file_actions_t
9293 return posix_spawn_file_actions_addchdir_np (file_actions, path);
9394 }
9495 return ENOSYS;
95- #elif defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || ( defined(__ANDROID__) && __ANDROID_API__ >= 34 ) || defined(__musl__)
96+ #elif defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__ANDROID__) || defined(__musl__)
9697 // Pre-standard posix_spawn_file_actions_addchdir_np version available in:
9798 // - Solaris 11.3 (October 2015)
9899 // - Glibc 2.29 (February 2019)
@@ -105,7 +106,6 @@ static int posix_spawn_file_actions_addchdir_polyfill(posix_spawn_file_actions_t
105106 // Standardized posix_spawn_file_actions_addchdir version (POSIX.1-2024, June 2024) available in:
106107 // - Solaris 11.4 (August 2018)
107108 // - NetBSD 10.0 (March 2024)
108- // - QNX 8 (December 2023)
109109 return posix_spawn_file_actions_addchdir ((posix_spawn_file_actions_t *)file_actions, path);
110110#endif
111111}
0 commit comments