mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std.process.Child: enable rusage collection for dragonfly, netbsd, openbsd
This commit is contained in:
parent
8657b409ba
commit
7685d12ece
1 changed files with 7 additions and 1 deletions
|
|
@ -122,7 +122,7 @@ pub const ResourceUsageStatistics = struct {
|
|||
/// if available.
|
||||
pub inline fn getMaxRss(rus: ResourceUsageStatistics) ?usize {
|
||||
switch (native_os) {
|
||||
.freebsd, .illumos, .linux, .serenity => {
|
||||
.dragonfly, .freebsd, .netbsd, .openbsd, .illumos, .linux, .serenity => {
|
||||
if (rus.rusage) |ru| {
|
||||
return @as(usize, @intCast(ru.maxrss)) * 1024;
|
||||
} else {
|
||||
|
|
@ -149,7 +149,10 @@ pub const ResourceUsageStatistics = struct {
|
|||
}
|
||||
|
||||
const rusage_init = switch (native_os) {
|
||||
.dragonfly,
|
||||
.freebsd,
|
||||
.netbsd,
|
||||
.openbsd,
|
||||
.illumos,
|
||||
.linux,
|
||||
.serenity,
|
||||
|
|
@ -497,7 +500,10 @@ fn waitUnwrappedPosix(self: *ChildProcess) void {
|
|||
const res: posix.WaitPidResult = res: {
|
||||
if (self.request_resource_usage_statistics) {
|
||||
switch (native_os) {
|
||||
.dragonfly,
|
||||
.freebsd,
|
||||
.netbsd,
|
||||
.openbsd,
|
||||
.illumos,
|
||||
.linux,
|
||||
.serenity,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue