From 6315c1a19061c4efaa45b32f54aef0994e48c3b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 16 Apr 2026 04:04:56 +0200 Subject: [PATCH] std.os.linux: remove vfork() It's a bad API with better alternatives on Linux, and is near-impossible to use safely in Zig code. closes https://codeberg.org/ziglang/zig/issues/31882 --- lib/std/os/linux.zig | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index 777b9eadaf7472e95b99f55791c48723baa6eeaf..ffe9ef15f3ba8823f94808cfd9f3d544a93bc71a 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -685,15 +685,6 @@ pub fn fork() usize { } } -/// This must be inline, and inline call the syscall function, because if the -/// child does a return it will clobber the parent's stack. -/// It is advised to avoid this function and use clone instead, because -/// the compiler is not aware of how vfork affects control flow and you may -/// see different results in optimized builds. -pub inline fn vfork() usize { - return @call(.always_inline, syscall0, .{.vfork}); -} - pub fn futimens(fd: fd_t, times: ?*const [2]timespec) usize { return utimensat(fd, null, times, 0); } -- 2.54.0