mirror of
https://github.com/ziglang/zig.git
synced 2025-12-30 18:13:19 +00:00
child_process: add ability to start child suspended on macOS
This commit is contained in:
parent
f7fea080b2
commit
c9d763502f
@ -60,6 +60,9 @@ pub const ChildProcess = struct {
|
||||
/// Darwin-only. Disable ASLR for the child process.
|
||||
disable_aslr: bool = false,
|
||||
|
||||
/// Darwin-only. Start child process in suspended state as if SIGSTOP was sent.
|
||||
start_suspended: bool = false,
|
||||
|
||||
pub const Arg0Expand = os.Arg0Expand;
|
||||
|
||||
pub const SpawnError = error{
|
||||
@ -578,6 +581,9 @@ pub const ChildProcess = struct {
|
||||
if (self.disable_aslr) {
|
||||
flags |= os.darwin._POSIX_SPAWN_DISABLE_ASLR;
|
||||
}
|
||||
if (self.start_suspended) {
|
||||
flags |= os.darwin.POSIX_SPAWN_START_SUSPENDED;
|
||||
}
|
||||
try attr.set(flags);
|
||||
|
||||
var actions = try os.posix_spawn.Actions.init();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user