| author | |
| committer | |
| log | fb366f3cd4a8a28a2a66753acc53d06a0d88c838 |
| tree | 4243467d2c6b4caeb4b87635014b77349bbcc072 |
| parent | 6af0eeb58d1d220d407ce4c463eaeb25b35f2761 |
Closes #129642 files changed, 14 insertions(+), 6 deletions(-)
lib/std/c/darwin.zig+2-2| ... | ... | @@ -80,11 +80,11 @@ pub extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: u |
| 80 | 80 | pub const posix_spawnattr_t = *opaque {}; |
| 81 | 81 | pub const posix_spawn_file_actions_t = *opaque {}; |
| 82 | 82 | pub extern "c" fn posix_spawnattr_init(attr: *posix_spawnattr_t) c_int; |
| 83 | pub extern "c" fn posix_spawnattr_destroy(attr: *posix_spawnattr_t) void; | |
| 83 | pub extern "c" fn posix_spawnattr_destroy(attr: *posix_spawnattr_t) c_int; | |
| 84 | 84 | pub extern "c" fn posix_spawnattr_setflags(attr: *posix_spawnattr_t, flags: c_short) c_int; |
| 85 | 85 | pub extern "c" fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *c_short) c_int; |
| 86 | 86 | pub extern "c" fn posix_spawn_file_actions_init(actions: *posix_spawn_file_actions_t) c_int; |
| 87 | pub extern "c" fn posix_spawn_file_actions_destroy(actions: *posix_spawn_file_actions_t) void; | |
| 87 | pub extern "c" fn posix_spawn_file_actions_destroy(actions: *posix_spawn_file_actions_t) c_int; | |
| 88 | 88 | pub extern "c" fn posix_spawn_file_actions_addclose(actions: *posix_spawn_file_actions_t, filedes: fd_t) c_int; |
| 89 | 89 | pub extern "c" fn posix_spawn_file_actions_addopen( |
| 90 | 90 | actions: *posix_spawn_file_actions_t, |
lib/std/os/posix_spawn.zig+12-4| ... | ... | @@ -47,8 +47,12 @@ const posix_spawn = if (builtin.target.isDarwin()) struct { |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | pub fn deinit(self: *Attr) void { |
| 50 | system.posix_spawnattr_destroy(&self.attr); | |
| 51 | self.* = undefined; | |
| 50 | defer self.* = undefined; | |
| 51 | switch (errno(system.posix_spawnattr_destroy(&self.attr))) { | |
| 52 | .SUCCESS => return, | |
| 53 | .INVAL => unreachable, // Invalid parameters. | |
| 54 | else => unreachable, | |
| 55 | } | |
| 52 | 56 | } |
| 53 | 57 | |
| 54 | 58 | pub fn get(self: Attr) Error!u16 { |
| ... | ... | @@ -83,8 +87,12 @@ const posix_spawn = if (builtin.target.isDarwin()) struct { |
| 83 | 87 | } |
| 84 | 88 | |
| 85 | 89 | pub fn deinit(self: *Actions) void { |
| 86 | system.posix_spawn_file_actions_destroy(&self.actions); | |
| 87 | self.* = undefined; | |
| 90 | defer self.* = undefined; | |
| 91 | switch (errno(system.posix_spawn_file_actions_destroy(&self.actions))) { | |
| 92 | .SUCCESS => return, | |
| 93 | .INVAL => unreachable, // Invalid parameters. | |
| 94 | else => unreachable, | |
| 95 | } | |
| 88 | 96 | } |
| 89 | 97 | |
| 90 | 98 | pub fn open(self: *Actions, fd: fd_t, path: []const u8, flags: u32, mode: mode_t) Error!void { |