mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
[sys/linux] Change flags parameter of execveat to bit_set
This commit is contained in:
@@ -1756,3 +1756,11 @@ EPoll_Ctl_Opcode :: enum i32 {
|
|||||||
DEL = 2,
|
DEL = 2,
|
||||||
MOD = 3,
|
MOD = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bits for execveat(2) flags.
|
||||||
|
*/
|
||||||
|
Execveat_Flags_Bits :: enum {
|
||||||
|
AT_SYMLINK_NOFOLLOW = 8,
|
||||||
|
AT_EMPTY_PATH = 12,
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ package linux
|
|||||||
that relative paths are relative to current directory.
|
that relative paths are relative to current directory.
|
||||||
*/
|
*/
|
||||||
AT_FDCWD :: Fd(-100)
|
AT_FDCWD :: Fd(-100)
|
||||||
AT_EMPTY_PATH :: 0x1000
|
|
||||||
AT_SYMLINK_NOFOLLOW :: 0x100
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Special value to put into timespec for utimensat() to set timestamp to the current time.
|
Special value to put into timespec for utimensat() to set timestamp to the current time.
|
||||||
|
|||||||
@@ -783,7 +783,7 @@ execve :: proc "contextless" (name: cstring, argv: [^]cstring, envp: [^]cstring)
|
|||||||
ret := syscall(SYS_execve, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp)
|
ret := syscall(SYS_execve, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp)
|
||||||
return Errno(-ret)
|
return Errno(-ret)
|
||||||
} else {
|
} else {
|
||||||
return execveat(AT_FDCWD, name, argv, envp, 0)
|
return execveat(AT_FDCWD, name, argv, envp, nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2816,8 +2816,8 @@ getrandom :: proc "contextless" (buf: []u8, flags: Get_Random_Flags) -> (int, Er
|
|||||||
Execute program relative to a directory file descriptor.
|
Execute program relative to a directory file descriptor.
|
||||||
Available since Linux 3.19.
|
Available since Linux 3.19.
|
||||||
*/
|
*/
|
||||||
execveat :: proc "contextless" (dirfd: Fd, name: cstring, argv: [^]cstring, envp: [^]cstring, flags: i32) -> (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, flags)
|
ret := syscall(SYS_execveat, dirfd, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp, transmute(i32) flags)
|
||||||
return Errno(-ret)
|
return Errno(-ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1238,3 +1238,8 @@ EPoll_Event :: struct #packed {
|
|||||||
events: EPoll_Event_Kind,
|
events: EPoll_Event_Kind,
|
||||||
data: EPoll_Data,
|
data: EPoll_Data,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Flags for execveat(2) syscall.
|
||||||
|
*/
|
||||||
|
Execveat_Flags :: bit_set[Execveat_Flags_Bits; i32]
|
||||||
|
|||||||
Reference in New Issue
Block a user