authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-12-12 22:28:15-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-12-12 22:28:15-05:00
logd770333827549e5dcbb727c7f434eaac9dd433d2
tree31cdb225e15570b0cda3a1f25cc2ee696a9d849d
parentb883bc873df7f1a8fa3a13800402e1ec8da74328
signaturelock-open Commit is signed but in an unrecognized format.

freebsd: fix os_self_exe_path function and update std lib


2 files changed, 5 insertions(+), 4 deletions(-)

src/os.cpp+1-1
......@@ -1456,7 +1456,7 @@ Error os_self_exe_path(Buf *out_path) {
14561456 if (sysctl(mib, 4, buf_ptr(out_path), &cb, nullptr, 0) != 0) {
14571457 return ErrorUnexpected;
14581458 }
1459 buf_resize(out_path, cb);
1459 buf_resize(out_path, cb - 1);
14601460 return ErrorNone;
14611461#endif
14621462 return ErrorFileNotFound;
std/os/freebsd/index.zig+4-3
......@@ -9,6 +9,7 @@ pub use @import("errno.zig");
99
1010const std = @import("../../index.zig");
1111const c = std.c;
12const maxInt = std.math.maxInt;
1213pub const Kevent = c.Kevent;
1314
1415pub const PATH_MAX = 1024;
......@@ -22,7 +23,7 @@ pub const PROT_READ = 1;
2223pub const PROT_WRITE = 2;
2324pub const PROT_EXEC = 4;
2425
25pub const MAP_FAILED = @maxValue(usize);
26pub const MAP_FAILED = maxInt(usize);
2627pub const MAP_SHARED = 0x0001;
2728pub const MAP_PRIVATE = 0x0002;
2829pub const MAP_FIXED = 0x0010;
......@@ -700,7 +701,7 @@ pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigacti
700701
701702const NSIG = 65;
702703const sigset_t = [128 / @sizeOf(usize)]usize;
703const all_mask = []usize{@maxValue(usize)};
704const all_mask = []usize{maxInt(usize)};
704705const app_mask = []usize{0xfffffffc7fffffff};
705706
706707/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
......@@ -711,7 +712,7 @@ pub const Sigaction = struct {
711712 flags: u32,
712713};
713714
714pub const SIG_ERR = @intToPtr(extern fn (i32) void, @maxValue(usize));
715pub const SIG_ERR = @intToPtr(extern fn (i32) void, maxInt(usize));
715716pub const SIG_DFL = @intToPtr(extern fn (i32) void, 0);
716717pub const SIG_IGN = @intToPtr(extern fn (i32) void, 1);
717718pub const empty_sigset = []usize{0} ** sigset_t.len;