diff options
| author | LemonBoy <thatlemon@gmail.com> | 2020-03-23 18:54:14 +0100 |
|---|---|---|
| committer | LemonBoy <thatlemon@gmail.com> | 2020-03-23 18:54:14 +0100 |
| commit | 761602e3e84afee1a77daf9f850c67cb8e25f7ed (patch) | |
| tree | c1e72f6ea4febdebd773eab186653edcdf600fd6 /lib/std/os.zig | |
| parent | 336ed03f0f4ffde8e60fb8b4859c0c2158511338 (diff) | |
| download | zig-761602e3e84afee1a77daf9f850c67cb8e25f7ed.tar.gz zig-761602e3e84afee1a77daf9f850c67cb8e25f7ed.zip | |
std: Use getdents on all the BSDs
* Use the correct versioned libc calls to avoid nasty surprises
Diffstat (limited to 'lib/std/os.zig')
| -rw-r--r-- | lib/std/os.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig index f03aa96cf9..4e25b254ea 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -3522,6 +3522,17 @@ pub fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) SigaltstackError!void { if (builtin.os.tag == .windows or builtin.os.tag == .uefi or builtin.os.tag == .wasi) @compileError("std.os.sigaltstack not available for this target"); + if (std.Target.current.os.tag == .netbsd) { + switch (errno(system.__sigaltstack14(ss, old_ss))) { + 0 => return, + EFAULT => unreachable, + EINVAL => unreachable, + ENOMEM => return error.SizeTooSmall, + EPERM => return error.PermissionDenied, + else => |err| return unexpectedErrno(err), + } + } + switch (errno(system.sigaltstack(ss, old_ss))) { 0 => return, EFAULT => unreachable, |
