authorgravatar for devnexen@gmail.comDavid Carlier <devnexen@gmail.com> 2023-05-24 19:00:30+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-05-29 22:08:43+03:00
log138f1253deb48434af707ec5e9124e889520be08
tree790fcbbe542c4995f90fbb296e9bd1dce9c889e9
parente2837fd2245c213c842617d6d98e311057893bb0

std.os: fix uname usage.

close #15839.

2 files changed, 24 insertions(+), 0 deletions(-)

lib/std/c/darwin.zig+12
...@@ -4161,3 +4161,15 @@ pub const PTHREAD_STACK_MIN = switch (builtin.cpu.arch) {...@@ -4161,3 +4161,15 @@ pub const PTHREAD_STACK_MIN = switch (builtin.cpu.arch) {
4161 .arm, .aarch64 => 16 * 1024,4161 .arm, .aarch64 => 16 * 1024,
4162 else => 8 * 1024,4162 else => 8 * 1024,
4163};4163};
4164
4165pub const _SYS_NAMELEN = 256;
4166
4167pub const utsname = extern struct {
4168 sysname: [255:0]u8,
4169 nodename: [255:0]u8,
4170 release: [255:0]u8,
4171 version: [255:0]u8,
4172 machine: [255:0]u8,
4173};
4174
4175pub extern "c" fn uname(u: *utsname) c_int;
lib/std/c/freebsd.zig+12
...@@ -2824,3 +2824,15 @@ pub const PTHREAD_STACK_MIN = switch (builtin.cpu.arch) {...@@ -2824,3 +2824,15 @@ pub const PTHREAD_STACK_MIN = switch (builtin.cpu.arch) {
2824 .x86, .powerpc => 4 * 512,2824 .x86, .powerpc => 4 * 512,
2825 else => 4 * 1024,2825 else => 4 * 1024,
2826};2826};
2827
2828pub const SYS_NMLN = 256;
2829
2830pub const utsname = extern struct {
2831 sysname: [255:0]u8,
2832 nodename: [255:0]u8,
2833 release: [255:0]u8,
2834 version: [255:0]u8,
2835 machine: [255:0]u8,
2836};
2837
2838pub extern "c" fn uname(u: *utsname) c_int;