From 45b931a23fb9a1c68c8de181ac02d39f51f7712b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 7 Jan 2026 15:01:37 -0800 Subject: [PATCH] goodbye posix.fork see #6600 nobody should be using fork anyway, especially Redis --- lib/std/posix.zig | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/std/posix.zig b/lib/std/posix.zig index e69ab2a75c7b215ce3d87f32e67bbbd3de4143c3..bba202423e5e516cae7eafe7efd6bccb208145ec 100644 --- a/lib/std/posix.zig +++ b/lib/std/posix.zig @@ -1046,18 +1046,6 @@ pub fn mprotect(memory: []align(page_size_min) u8, protection: u32) MProtectErro } } -pub const ForkError = error{SystemResources} || UnexpectedError; - -pub fn fork() ForkError!pid_t { - const rc = system.fork(); - switch (errno(rc)) { - .SUCCESS => return @intCast(rc), - .AGAIN => return error.SystemResources, - .NOMEM => return error.SystemResources, - else => |err| return unexpectedErrno(err), - } -} - pub const MMapError = error{ /// The underlying filesystem of the specified file does not support memory mapping. MemoryMappingNotSupported, -- 2.54.0