Skip to content

Commit

Permalink
std.os: fix uname usage.
Browse files Browse the repository at this point in the history
close #15839.
  • Loading branch information
devnexen authored and Vexu committed May 29, 2023
1 parent e2837fd commit 138f125
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/std/c/darwin.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4161,3 +4161,15 @@ pub const PTHREAD_STACK_MIN = switch (builtin.cpu.arch) {
.arm, .aarch64 => 16 * 1024,
else => 8 * 1024,
};

pub const _SYS_NAMELEN = 256;

pub const utsname = extern struct {
sysname: [255:0]u8,
nodename: [255:0]u8,
release: [255:0]u8,
version: [255:0]u8,
machine: [255:0]u8,
};

pub extern "c" fn uname(u: *utsname) c_int;
12 changes: 12 additions & 0 deletions lib/std/c/freebsd.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2824,3 +2824,15 @@ pub const PTHREAD_STACK_MIN = switch (builtin.cpu.arch) {
.x86, .powerpc => 4 * 512,
else => 4 * 1024,
};

pub const SYS_NMLN = 256;

pub const utsname = extern struct {
sysname: [255:0]u8,
nodename: [255:0]u8,
release: [255:0]u8,
version: [255:0]u8,
machine: [255:0]u8,
};

pub extern "c" fn uname(u: *utsname) c_int;

0 comments on commit 138f125

Please sign in to comment.