|
@@ -749,17 +749,13 @@ getsockopt :: proc {
|
|
|
getsockopt_base,
|
|
|
}
|
|
|
|
|
|
-// TODO(flysand): clone (probably not in this PR, maybe not ever)
|
|
|
-
|
|
|
/*
|
|
|
Creates a copy of the running process.
|
|
|
Available since Linux 1.0.
|
|
|
*/
|
|
|
fork :: proc "contextless" () -> (Pid, Errno) {
|
|
|
when ODIN_ARCH == .arm64 {
|
|
|
- // Note(flysand): this syscall is not documented, but the bottom 8 bits of flags
|
|
|
- // are for exit signal
|
|
|
- ret := syscall(SYS_clone, Signal.SIGCHLD)
|
|
|
+ ret := syscall(SYS_clone, u64(Signal.SIGCHLD), cast(rawptr) nil, cast(rawptr) nil, cast(rawptr) nil, u64(0))
|
|
|
return errno_unwrap(ret, Pid)
|
|
|
} else {
|
|
|
ret := syscall(SYS_fork)
|
|
@@ -789,8 +785,8 @@ execve :: proc "contextless" (name: cstring, argv: [^]cstring, envp: [^]cstring)
|
|
|
ret := syscall(SYS_execve, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp)
|
|
|
return Errno(-ret)
|
|
|
} else {
|
|
|
- ret := syscall(SYS_execveat, AT_FDCWD, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp)
|
|
|
- return Errno(-ret)
|
|
|
+ ret := syscall(SYS_execveat, AT_FDCWD, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp, i32(0))
|
|
|
+ return Errno(-ret)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2818,7 +2814,7 @@ getrandom :: proc "contextless" (buf: []u8, flags: Get_Random_Flags) -> (int, Er
|
|
|
Execute program relative to a directory file descriptor.
|
|
|
Available since Linux 3.19.
|
|
|
*/
|
|
|
-execveat :: proc "contextless" (dirfd: Fd, name: cstring, argv: [^]cstring, envp: [^]cstring, flags: FD_Flags = {}) -> (Errno) {
|
|
|
+execveat :: proc "contextless" (dirfd: Fd, name: cstring, argv: [^]cstring, envp: [^]cstring, flags: Execveat_Flags = {}) -> (Errno) {
|
|
|
ret := syscall(SYS_execveat, dirfd, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp, transmute(i32) flags)
|
|
|
return Errno(-ret)
|
|
|
}
|