aboutsummaryrefslogtreecommitdiff
path: root/core/sys/linux
diff options
context:
space:
mode:
authorjason <jkercher43@gmail.com>2024-08-04 00:59:40 -0400
committerjason <jkercher43@gmail.com>2024-08-04 00:59:40 -0400
commit2a7db08c20811139c9410b65499d27eca47e793c (patch)
treec255127a2941f7d16ac8cd3f77d1e2bc0629c8c6 /core/sys/linux
parent2b89829b5259a8e7120514f9d9592a82271dfaee (diff)
Remove returned bool from access and faccessat in sys/linux.
Switch to using AT_EMPTY_PATH to execve with file descriptors.
Diffstat (limited to 'core/sys/linux')
-rw-r--r--core/sys/linux/sys.odin14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/sys/linux/sys.odin b/core/sys/linux/sys.odin
index ec7357c48..d756f0ece 100644
--- a/core/sys/linux/sys.odin
+++ b/core/sys/linux/sys.odin
@@ -279,13 +279,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)
}
}
@@ -2616,9 +2616,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)
}
/*
@@ -2916,9 +2916,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