You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been deemed too tricky to make this API safe and there are relatively few use cases anyways, considering we want to use posix_spawn internally as much as possible.
Closes#148
Copy file name to clipboardExpand all lines: Sources/Subprocess/Platforms/Subprocess+Darwin.swift
+1-26Lines changed: 1 addition & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -81,29 +81,6 @@ public struct PlatformOptions: Sendable {
81
81
inoutposix_spawn_file_actions_t?
82
82
)throws->Void
83
83
)?=nil
84
-
/// A closure to configure platform-specific
85
-
/// spawning constructs. This closure enables direct
86
-
/// configuration or override of underlying platform-specific
87
-
/// spawn settings that `Subprocess` utilizes internally,
88
-
/// in cases where Subprocess does not provide higher-level
89
-
/// APIs for such modifications.
90
-
///
91
-
/// On Darwin, Subprocess uses `posix_spawn()` as the
92
-
/// underlying spawning mechanism, but may require an initial `fork()`
93
-
/// depending on the configured `PlatformOptions`.
94
-
/// This closure is called after `fork()` but before `posix_spawn()`
95
-
/// (with the `POSIX_SPAWN_SETEXEC` flag set).
96
-
/// You may use it to call any necessary process setup functions.
97
-
///
98
-
/// - note: You can set both `preExecProcessAction` and
99
-
/// `preSpawnProcessConfigurator` and both will be called.
100
-
/// Setting `preExecProcessAction` will always cause Subprocess
101
-
/// to pre-`fork()` before calling `posix_spawn()` (with the
102
-
/// `POSIX_SPAWN_SETEXEC` flag set) even if it would not have otherwise
103
-
/// done so based on the configured `PlatformOptions`.
104
-
///
105
-
/// - warning: You may ONLY call [async-signal-safe functions](https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html) within this closure (note _"The following table defines a set of functions and function-like macros that shall be async-signal-safe."_).
Copy file name to clipboardExpand all lines: Sources/Subprocess/Platforms/Subprocess+Linux.swift
+2-18Lines changed: 2 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -151,8 +151,7 @@ extension Configuration {
151
151
processGroupIDPtr,
152
152
CInt(supplementaryGroups?.count ??0),
153
153
sgroups?.baseAddress,
154
-
self.platformOptions.createSession ?1:0,
155
-
self.platformOptions.preExecProcessAction
154
+
self.platformOptions.createSession ?1:0
156
155
)
157
156
}
158
157
}
@@ -284,20 +283,6 @@ public struct PlatformOptions: Sendable {
284
283
/// the child process terminates.
285
284
/// Always ends in sending a `.kill` signal at the end.
286
285
publicvarteardownSequence:[TeardownStep]=[]
287
-
/// A closure to configure platform-specific
288
-
/// spawning constructs. This closure enables direct
289
-
/// configuration or override of underlying platform-specific
290
-
/// spawn settings that `Subprocess` utilizes internally,
291
-
/// in cases where Subprocess does not provide higher-level
292
-
/// APIs for such modifications.
293
-
///
294
-
/// On Linux, Subprocess uses `fork/exec` as the
295
-
/// underlying spawning mechanism. This closure is called
296
-
/// after `fork()` but before `exec()`. You may use it to
297
-
/// call any necessary process setup functions.
298
-
///
299
-
/// - warning: You may ONLY call [async-signal-safe functions](https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html) within this closure (note _"The following table defines a set of functions and function-like macros that shall be async-signal-safe."_).
0 commit comments