authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-12-10 22:55:04+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-12-10 22:55:04+01:00
logc9d763502fb1ff9ee76f0745c493e65c1333b1b1
treedaba178316e995df2577f8e55d4a6fb75474fa14
parentf7fea080b25f932b352d38f126e0a179c5163f68

child_process: add ability to start child suspended on macOS


1 files changed, 6 insertions(+), 0 deletions(-)

lib/std/child_process.zig+6
......@@ -60,6 +60,9 @@ pub const ChildProcess = struct {
6060 /// Darwin-only. Disable ASLR for the child process.
6161 disable_aslr: bool = false,
6262
63 /// Darwin-only. Start child process in suspended state as if SIGSTOP was sent.
64 start_suspended: bool = false,
65
6366 pub const Arg0Expand = os.Arg0Expand;
6467
6568 pub const SpawnError = error{
......@@ -578,6 +581,9 @@ pub const ChildProcess = struct {
578581 if (self.disable_aslr) {
579582 flags |= os.darwin._POSIX_SPAWN_DISABLE_ASLR;
580583 }
584 if (self.start_suspended) {
585 flags |= os.darwin.POSIX_SPAWN_START_SUSPENDED;
586 }
581587 try attr.set(flags);
582588
583589 var actions = try os.posix_spawn.Actions.init();