commit 44543800a59968a4c7a2cdcf10837bc17b52553d (tree)
parent 2659fadb959b8ad0a5db374b3d7b3892ea0ee4f7
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Wed, 3 Dec 2025 03:39:23 +0100
std.process.Child: enable rusage collection for dragonfly, netbsd, openbsd
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/std/process/Child.zig b/lib/std/process/Child.zig
@@ -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,