head 1.2; access; symbols pkgsrc-2020Q1:1.1.0.2 pkgsrc-2020Q1-base:1.1; locks; strict; comment @# @; 1.2 date 2020.04.18.08.08.07; author adam; state dead; branches; next 1.1; commitid 9DQvWpsXcrpLdQ4C; 1.1 date 2020.03.25.22.27.20; author nia; state Exp; branches; next ; commitid Uuaz9IKjBYLGJP1C; desc @@ 1.2 log @zig: updated to 0.6.0 Language Changes in 0.6.0: Improved names of error sets when using merge error sets operator (||). pub syntax for container fields is removed. Type coercion from *[0]T to E![]const T is now allowed. This is an unambiguous, safe cast. asm now accepts comptime-known values, rather than requiring string literal syntax. Removed compile error for peer result ?comptime_int and null. Ability to pass comptime types and non comptime types to same parameter. @@typeOf is renamed to @@TypeOf. zig fmt automatically performs the conversion, and the next release of Zig after this one will remove the automatic conversion. Ability to switch on pointer types. Multiline strings in test and library names are disallowed. Zig language no longer requires the expression a else unreachable with comptime a to produce a comptime result. Timon Kruiper implemented casting between [*c]T and ?[*:0]T on fn parameter. Timon Kruiper improved @@typeInfo to lazily resolve declarations. This way all the declarations in a namespace won't be resolved until the user actually uses the declarations slice in the builtin TypeInfo union. @@ptrCast supports casting a slice to a pointer. LemonBoy implemented peer type resolution between ?[]T and *[N]T. There is now peer type resolution between mixed-const []T and *[N]T. @ text @$NetBSD: patch-lib_std_os.zig,v 1.1 2020/03/25 22:27:20 nia Exp $ NetBSD fixes. Based on: https://github.com/ziglang/zig/pull/4793 --- lib/std/os.zig.orig 2019-09-30 15:40:00.000000000 +0000 +++ lib/std/os.zig @@@@ -1841,6 +1841,16 @@@@ pub fn fstat(fd: fd_t) FStatError!Stat { } } + if (netbsd.is_the_target) { + switch (errno(system.__fstat50(fd, &stat))) { + 0 => return stat, + EINVAL => unreachable, + EBADF => unreachable, // Always a race condition. + ENOMEM => return error.SystemResources, + else => |err| return unexpectedErrno(err), + } + } + switch (errno(system.fstat(fd, &stat))) { 0 => return stat, EINVAL => unreachable, @@@@ -2554,6 +2564,14 @@@@ pub const ClockGetTimeError = error{ }; pub fn clock_gettime(clk_id: i32, tp: *timespec) ClockGetTimeError!void { + if (netbsd.is_the_target) { + switch (errno(system.__clock_gettime50(ss, old_ss))) { + 0 => return, + EFAULT => unreachable, + EINVAL => return error.UnsupportedClock, + else => |err| return unexpectedErrno(err), + } + } switch (errno(system.clock_gettime(clk_id, tp))) { 0 => return, EFAULT => unreachable, @@@@ -2563,6 +2581,14 @@@@ pub fn clock_gettime(clk_id: i32, tp: *t } pub fn clock_getres(clk_id: i32, res: *timespec) ClockGetTimeError!void { + if (netbsd.is_the_target) { + switch (errno(system.__clock_getres50(ss, old_ss))) { + 0 => return, + EFAULT => unreachable, + EINVAL => return error.UnsupportedClock, + else => |err| return unexpectedErrno(err), + } + } switch (errno(system.clock_getres(clk_id, res))) { 0 => return, EFAULT => unreachable, @@@@ -2635,6 +2661,17 @@@@ pub fn sigaltstack(ss: ?*stack_t, old_ss if (windows.is_the_target or uefi.is_the_target or wasi.is_the_target) @@compileError("std.os.sigaltstack not available for this target"); + if (netbsd.is_the_target) { + 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, @ 1.1 log @zig: Update to 0.5.0. Unbreak. This version of zig supports the current version of llvm in pkgsrc (9). Some patches from TheLemonMan were backported by me to fix NetBSD support. Release notes: https://ziglang.org/download/0.5.0/release-notes.html @ text @d1 1 a1 1 $NetBSD$ @