authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-20 16:43:07 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-20 16:43:07 -07:00
log868f414152de3f73b7e6ba5b4b627b95252f2afc
treea5f3d9bdc5b8b466613347c828884fe37f3ec157
parente4a20839eb7acf88901557e0aa4561add16e17b7

add vfork


2 files changed, 8 insertions(+), 1 deletions(-)

mod.zig+7-1
......@@ -345,7 +345,13 @@ pub fn fork() errno.Error!pid_t {
345345// vfork
346346// pid_t vfork(void);
347347// asmlinkage long sys_vfork(void);
348pub const vfork = @compileError("TODO: vfork");
348pub fn vfork() errno.Error!pid_t {
349 const r = syscall0(.vfork);
350 return switch (_errno(r)) {
351 .ok => @intCast(r),
352 _ => |c| errno.errorFromInt(@intFromEnum(c)),
353 };
354}
349355
350356// execve
351357// int execve(const char *pathname, char *const _Nullable argv[], char *const _Nullable envp[]);
test.zig+1
......@@ -11,4 +11,5 @@ test {
1111 _ = &linux.pause;
1212 _ = &linux.getpid;
1313 _ = &linux.fork;
14 _ = &linux.vfork;
1415}