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
This commit is contained in:
Alex Rønne Petersen
2026-04-16 04:04:56 +02:00
parent 67023fc4bd
commit 6315c1a190
-9
View File
@@ -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);
}