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
2ca48d323b
commit
e2e64fd9c4
1 changed files with 7 additions and 1 deletions
|
|
@ -122,7 +122,7 @@ pub const ResourceUsageStatistics = struct {
|
||||||
/// if available.
|
/// if available.
|
||||||
pub inline fn getMaxRss(rus: ResourceUsageStatistics) ?usize {
|
pub inline fn getMaxRss(rus: ResourceUsageStatistics) ?usize {
|
||||||
switch (native_os) {
|
switch (native_os) {
|
||||||
.freebsd, .illumos, .linux, .serenity => {
|
.dragonfly, .freebsd, .netbsd, .openbsd, .illumos, .linux, .serenity => {
|
||||||
if (rus.rusage) |ru| {
|
if (rus.rusage) |ru| {
|
||||||
return @as(usize, @intCast(ru.maxrss)) * 1024;
|
return @as(usize, @intCast(ru.maxrss)) * 1024;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -149,7 +149,10 @@ pub const ResourceUsageStatistics = struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
const rusage_init = switch (native_os) {
|
const rusage_init = switch (native_os) {
|
||||||
|
.dragonfly,
|
||||||
.freebsd,
|
.freebsd,
|
||||||
|
.netbsd,
|
||||||
|
.openbsd,
|
||||||
.illumos,
|
.illumos,
|
||||||
.linux,
|
.linux,
|
||||||
.serenity,
|
.serenity,
|
||||||
|
|
@ -497,7 +500,10 @@ fn waitUnwrappedPosix(self: *ChildProcess) void {
|
||||||
const res: posix.WaitPidResult = res: {
|
const res: posix.WaitPidResult = res: {
|
||||||
if (self.request_resource_usage_statistics) {
|
if (self.request_resource_usage_statistics) {
|
||||||
switch (native_os) {
|
switch (native_os) {
|
||||||
|
.dragonfly,
|
||||||
.freebsd,
|
.freebsd,
|
||||||
|
.netbsd,
|
||||||
|
.openbsd,
|
||||||
.illumos,
|
.illumos,
|
||||||
.linux,
|
.linux,
|
||||||
.serenity,
|
.serenity,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue