@@ -79,20 +79,19 @@ 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)
82
+ #if ( defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29)) || (defined(__OpenBSD__)) || (defined(__ANDROID__) && __ANDROID_API__ < 34 )
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
+ // Currently missing as of:
86
+ // - OpenBSD 7.5 (April 2024)
87
+ // - Android <= 14
85
88
return ENOSYS;
86
89
#elif defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500
87
90
// Conditionally available on macOS if building with a deployment target older than 10.15
88
91
if (__builtin_available (macOS 10.15 , *)) {
89
92
return posix_spawn_file_actions_addchdir_np (file_actions, path);
90
93
}
91
94
return ENOSYS;
92
- #elif defined(__OpenBSD__)
93
- // Currently missing as of:
94
- // - OpenBSD 7.5 (April 2024)
95
- return ENOSYS;
96
95
#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || (defined(__ANDROID__) && __ANDROID_API__ >= 34) || defined(__musl__)
97
96
// Pre-standard posix_spawn_file_actions_addchdir_np version available in:
98
97
// - Solaris 11.3 (October 2015)
@@ -102,9 +101,6 @@ static int posix_spawn_file_actions_addchdir_polyfill(posix_spawn_file_actions_t
102
101
// - FreeBSD 13.1 (May 2022)
103
102
// - Android 14 (October 2023)
104
103
return posix_spawn_file_actions_addchdir_np ((posix_spawn_file_actions_t *)file_actions, path);
105
- #elif defined(__ANDROID__) && __ANDROID_API__ < 34
106
- // - Android < 14
107
- return ENOSYS;
108
104
#else
109
105
// Standardized posix_spawn_file_actions_addchdir version (POSIX.1-2024, June 2024) available in:
110
106
// - Solaris 11.4 (August 2018)
0 commit comments