aboutsummaryrefslogtreecommitdiff
path: root/core/sys/linux
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-08-16 12:38:27 +0100
committerGitHub <noreply@github.com>2024-08-16 12:38:27 +0100
commit31bb3dc4f07141430448686ffed46bf830b828b5 (patch)
treefc434540e7580796e14c9e84babf313e63ceb2a5 /core/sys/linux
parent65ce7687d7b8892f20a9967e41a58e14fa5d9caa (diff)
parent07a9c69714fa8700ae888e9a52988afc760ba9ff (diff)
Merge pull request #3971 from jasonKercher/os2-process-linux
os2 process linux implementation
Diffstat (limited to 'core/sys/linux')
-rw-r--r--core/sys/linux/bits.odin14
-rw-r--r--core/sys/linux/sys.odin14
2 files changed, 21 insertions, 7 deletions
diff --git a/core/sys/linux/bits.odin b/core/sys/linux/bits.odin
index e10edf558..b8ec3c133 100644
--- a/core/sys/linux/bits.odin
+++ b/core/sys/linux/bits.odin
@@ -984,6 +984,20 @@ Sig_Action_Flag :: enum u32 {
}
/*
+ Translation of code in Sig_Info for when signo is SIGCHLD
+*/
+Sig_Child_Code :: enum {
+ NONE,
+ EXITED,
+ KILLED,
+ DUMPED,
+ TRAPPED,
+ STOPPED,
+ CONTINUED,
+}
+
+
+/*
Type of socket to create
- For TCP you want to use SOCK_STREAM
- For UDP you want to use SOCK_DGRAM
diff --git a/core/sys/linux/sys.odin b/core/sys/linux/sys.odin
index d729ab330..f4f609ab9 100644
--- a/core/sys/linux/sys.odin
+++ b/core/sys/linux/sys.odin
@@ -290,13 +290,13 @@ writev :: proc "contextless" (fd: Fd, iov: []IO_Vec) -> (int, Errno) {
Available since Linux 1.0.
For ARM64 available since Linux 2.6.16.
*/
-access :: proc "contextless" (name: cstring, mode: Mode = F_OK) -> (bool, Errno) {
+access :: proc "contextless" (name: cstring, mode: Mode = F_OK) -> (Errno) {
when ODIN_ARCH == .arm64 {
ret := syscall(SYS_faccessat, AT_FDCWD, cast(rawptr) name, transmute(u32) mode)
- return errno_unwrap(ret, bool)
+ return Errno(-ret)
} else {
ret := syscall(SYS_access, cast(rawptr) name, transmute(u32) mode)
- return errno_unwrap(ret, bool)
+ return Errno(-ret)
}
}
@@ -2627,9 +2627,9 @@ fchmodat :: proc "contextless" (dirfd: Fd, name: cstring, mode: Mode, flags: FD_
Checks the user permissions for a file at specified dirfd.
Available since Linux 2.6.16.
*/
-faccessat :: proc "contextless" (dirfd: Fd, name: cstring, mode: Mode = F_OK) -> (bool, Errno) {
+faccessat :: proc "contextless" (dirfd: Fd, name: cstring, mode: Mode = F_OK) -> (Errno) {
ret := syscall(SYS_faccessat, dirfd, cast(rawptr) name, transmute(u32) mode)
- return errno_unwrap(ret, bool)
+ return Errno(-ret)
}
/*
@@ -2927,9 +2927,9 @@ pidfd_getfd :: proc "contextless" (pidfd: Pid_FD, fd: Fd, flags: i32 = 0) -> (Fd
Checks the user permissions for a file at specified dirfd (with flags).
Available since Linux 5.8.
*/
-faccessat2 :: proc "contextless" (dirfd: Fd, name: cstring, mode: Mode = F_OK, flags: FD_Flags = FD_Flags{}) -> (bool, Errno) {
+faccessat2 :: proc "contextless" (dirfd: Fd, name: cstring, mode: Mode = F_OK, flags: FD_Flags = FD_Flags{}) -> (Errno) {
ret := syscall(SYS_faccessat2, dirfd, cast(rawptr) name, transmute(u32) mode, transmute(i32) flags)
- return errno_unwrap(ret, bool)
+ return Errno(-ret)
}
// TODO(flysand): process_madvise