From fd3f676cdbe212a00bae8e49185382c5848d9680 Mon Sep 17 00:00:00 2001 From: Benjamin Feng Date: Thu, 8 Oct 2020 15:19:52 -0500 Subject: [PATCH 1/2] Pull in Darwin definitions for rusage --- lib/std/os/bits/darwin.zig | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/std/os/bits/darwin.zig b/lib/std/os/bits/darwin.zig index ce73d2a6d..9de24c352 100644 --- a/lib/std/os/bits/darwin.zig +++ b/lib/std/os/bits/darwin.zig @@ -1474,3 +1474,25 @@ pub const CLOCK_UPTIME_RAW = 8; pub const CLOCK_UPTIME_RAW_APPROX = 9; pub const CLOCK_PROCESS_CPUTIME_ID = 12; pub const CLOCK_THREAD_CPUTIME_ID = 16; + +pub const RUSAGE_SELF = 0; +pub const RUSAGE_CHILDREN = -1; + +pub const rusage = extern struct { + utime: timeval, + stime: timeval, + maxrss: isize, + ixrss: isize, + idrss: isize, + isrss: isize, + minflt: isize, + majflt: isize, + nswap: isize, + inblock: isize, + oublock: isize, + msgsnd: isize, + msgrcv: isize, + nsignals: isize, + nvcsw: isize, + nivcsw: isize, +}; From 9de0f15b8e4040921277b55e3b26d76ce1492e0f Mon Sep 17 00:00:00 2001 From: Benjamin Feng Date: Thu, 8 Oct 2020 15:31:36 -0500 Subject: [PATCH 2/2] Rename ix_rss -> ixrss --- lib/std/os/bits/linux.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig index 1ead0c796..a79fc0b7d 100644 --- a/lib/std/os/bits/linux.zig +++ b/lib/std/os/bits/linux.zig @@ -1769,7 +1769,7 @@ pub const rusage = extern struct { utime: timeval, stime: timeval, maxrss: isize, - ix_rss: isize, + ixrss: isize, idrss: isize, isrss: isize, minflt: isize,