| author | |
| committer | |
| log | 6f15eedff1bd32085808ab58f095ab549b493745 |
| tree | a5163457ff5865162d18bdead72ec12d95d4eedc |
| parent | 0aab3bda126b0221f81533b335c7a6a01749344b |
2 files changed, 19 insertions(+), 13 deletions(-)
lib/std/c/darwin.zig+12-10| ... | @@ -3033,16 +3033,18 @@ pub const caddr_t = ?[*]u8; | ... | @@ -3033,16 +3033,18 @@ pub const caddr_t = ?[*]u8; |
| 3033 | 3033 | ||
| 3034 | pub extern "c" fn ptrace(request: c_int, pid: pid_t, addr: caddr_t, data: c_int) c_int; | 3034 | pub extern "c" fn ptrace(request: c_int, pid: pid_t, addr: caddr_t, data: c_int) c_int; |
| 3035 | 3035 | ||
| 3036 | pub const POSIX_SPAWN_RESETIDS = 0x0001; | 3036 | pub const POSIX_SPAWN = struct { |
| 3037 | pub const POSIX_SPAWN_SETPGROUP = 0x0002; | 3037 | pub const RESETIDS = 0x0001; |
| 3038 | pub const POSIX_SPAWN_SETSIGDEF = 0x0004; | 3038 | pub const SETPGROUP = 0x0002; |
| 3039 | pub const POSIX_SPAWN_SETSIGMASK = 0x0008; | 3039 | pub const SETSIGDEF = 0x0004; |
| 3040 | pub const POSIX_SPAWN_SETEXEC = 0x0040; | 3040 | pub const SETSIGMASK = 0x0008; |
| 3041 | pub const POSIX_SPAWN_START_SUSPENDED = 0x0080; | 3041 | pub const SETEXEC = 0x0040; |
| 3042 | pub const _POSIX_SPAWN_DISABLE_ASLR = 0x0100; | 3042 | pub const START_SUSPENDED = 0x0080; |
| 3043 | pub const POSIX_SPAWN_SETSID = 0x0400; | 3043 | pub const DISABLE_ASLR = 0x0100; |
| 3044 | pub const _POSIX_SPAWN_RESLIDE = 0x0800; | 3044 | pub const SETSID = 0x0400; |
| 3045 | pub const POSIX_SPAWN_CLOEXEC_DEFAULT = 0x4000; | 3045 | pub const RESLIDE = 0x0800; |
| 3046 | pub const CLOEXEC_DEFAULT = 0x4000; | ||
| 3047 | }; | ||
| 3046 | 3048 | ||
| 3047 | pub const posix_spawnattr_t = *opaque {}; | 3049 | pub const posix_spawnattr_t = *opaque {}; |
| 3048 | pub const posix_spawn_file_actions_t = *opaque {}; | 3050 | pub const posix_spawn_file_actions_t = *opaque {}; |
src/main.zig+7-3| ... | @@ -3852,11 +3852,15 @@ fn runOrTestHotSwap( | ... | @@ -3852,11 +3852,15 @@ fn runOrTestHotSwap( |
| 3852 | switch (builtin.target.os.tag) { | 3852 | switch (builtin.target.os.tag) { |
| 3853 | .macos, .ios, .tvos, .watchos => { | 3853 | .macos, .ios, .tvos, .watchos => { |
| 3854 | const PosixSpawn = std.os.darwin.PosixSpawn; | 3854 | const PosixSpawn = std.os.darwin.PosixSpawn; |
| 3855 | |||
| 3855 | var attr = try PosixSpawn.Attr.init(); | 3856 | var attr = try PosixSpawn.Attr.init(); |
| 3856 | defer attr.deinit(); | 3857 | defer attr.deinit(); |
| 3857 | const flags: u16 = std.os.darwin.POSIX_SPAWN_SETSIGDEF | | 3858 | |
| 3858 | std.os.darwin.POSIX_SPAWN_SETSIGMASK | | 3859 | // ASLR is probably a good default for better debugging experience/programming |
| 3859 | std.os.darwin._POSIX_SPAWN_DISABLE_ASLR; | 3860 | // with hot-code updates in mind. However, we can also make it work with ASLR on. |
| 3861 | const flags: u16 = std.os.darwin.POSIX_SPAWN.SETSIGDEF | | ||
| 3862 | std.os.darwin.POSIX_SPAWN.SETSIGMASK | | ||
| 3863 | std.os.darwin.POSIX_SPAWN.DISABLE_ASLR; | ||
| 3860 | try attr.set(flags); | 3864 | try attr.set(flags); |
| 3861 | 3865 | ||
| 3862 | var arena_allocator = std.heap.ArenaAllocator.init(gpa); | 3866 | var arena_allocator = std.heap.ArenaAllocator.init(gpa); |