authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-07 15:01:37-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-07 17:33:07-08:00
log45b931a23fb9a1c68c8de181ac02d39f51f7712b
tree703b35840616b52a03845a28a82846fdc7444e52
parent3961fe3de9713e3e618551cd96873a7b3948a2b2

goodbye posix.fork

see #6600 nobody should be using fork anyway, especially Redis

1 files changed, 0 insertions(+), 12 deletions(-)

lib/std/posix.zig-12
......@@ -1046,18 +1046,6 @@ pub fn mprotect(memory: []align(page_size_min) u8, protection: u32) MProtectErro
10461046 }
10471047}
10481048
1049pub const ForkError = error{SystemResources} || UnexpectedError;
1050
1051pub fn fork() ForkError!pid_t {
1052 const rc = system.fork();
1053 switch (errno(rc)) {
1054 .SUCCESS => return @intCast(rc),
1055 .AGAIN => return error.SystemResources,
1056 .NOMEM => return error.SystemResources,
1057 else => |err| return unexpectedErrno(err),
1058 }
1059}
1060
10611049pub const MMapError = error{
10621050 /// The underlying filesystem of the specified file does not support memory mapping.
10631051 MemoryMappingNotSupported,