@@ -79,11 +79,12 @@ int pthread_fchdir_np(int fd)
79
79
// Implementation mostly copied from _CFPosixSpawnFileActionsChdir in swift-corelibs-foundation
80
80
static int posix_spawn_file_actions_addchdir_polyfill (posix_spawn_file_actions_t * __restrict file_actions,
81
81
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__))
83
83
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
84
84
// - Amazon Linux 2 (EoL mid-2025)
85
85
// Currently missing as of:
86
86
// - OpenBSD 7.5 (April 2024)
87
+ // - QNX 8 (December 2023)
87
88
// - Android <= 14
88
89
return ENOSYS;
89
90
#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
92
93
return posix_spawn_file_actions_addchdir_np (file_actions, path);
93
94
}
94
95
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__)
96
97
// Pre-standard posix_spawn_file_actions_addchdir_np version available in:
97
98
// - Solaris 11.3 (October 2015)
98
99
// - Glibc 2.29 (February 2019)
@@ -105,7 +106,6 @@ static int posix_spawn_file_actions_addchdir_polyfill(posix_spawn_file_actions_t
105
106
// Standardized posix_spawn_file_actions_addchdir version (POSIX.1-2024, June 2024) available in:
106
107
// - Solaris 11.4 (August 2018)
107
108
// - NetBSD 10.0 (March 2024)
108
- // - QNX 8 (December 2023)
109
109
return posix_spawn_file_actions_addchdir ((posix_spawn_file_actions_t *)file_actions, path);
110
110
#endif
111
111
}
0 commit comments