@@ -57,10 +57,15 @@ private let _posix_spawn_file_actions_addclosefrom_np = symbol(named: "posix_spa
57
57
/// consistently available across all platforms that implement the
58
58
/// `posix_spawn()` API.
59
59
private let _posix_spawn_file_actions_addchdir = symbol ( named: " posix_spawn_file_actions_addchdir " ) . map {
60
- castCFunction ( at: $0, to: ( @convention( c) ( UnsafeMutablePointer < P < posix_spawn_file_actions_t > > , UnsafePointer < CChar > ) - > CInt) . self)
60
+ print ( " !!FOUND posix_spawn_file_actions_addchdir " )
61
+ return castCFunction ( at: $0, to: ( @convention( c) ( UnsafeMutablePointer < P < posix_spawn_file_actions_t > > , UnsafePointer < CChar > ) - > CInt) . self)
61
62
} ?? symbol ( named: " posix_spawn_file_actions_addchdir_np " ) . map {
62
- castCFunction ( at: $0, to: ( @convention( c) ( UnsafeMutablePointer < P < posix_spawn_file_actions_t > > , UnsafePointer < CChar > ) - > CInt) . self)
63
- }
63
+ print ( " !!FOUND posix_spawn_file_actions_addchdir_np " )
64
+ return castCFunction ( at: $0, to: ( @convention( c) ( UnsafeMutablePointer < P < posix_spawn_file_actions_t > > , UnsafePointer < CChar > ) - > CInt) . self)
65
+ } ?? {
66
+ print ( " !!DID NOT FIND posix_spawn_file_actions_addchdir[_np] " )
67
+ return nil
68
+ } ( )
64
69
#endif
65
70
#endif
66
71
@@ -158,6 +163,7 @@ func spawnExecutable(
158
163
// posix_spawn(), so set it here in the parent process and hope
159
164
// another thread does not stomp on the change (as Foundation does.)
160
165
// Platforms known to take this path: Amazon Linux 2, OpenBSD, QNX
166
+ print ( " !!CALLING chdir " )
161
167
guard 0 == chdir ( currentDirectoryPath) else {
162
168
throw CError ( rawValue: swt_errno ( ) )
163
169
}
0 commit comments