mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-20 14:41:09 +00:00
linux: implement eventfd syscall
This commit is contained in:
@@ -2269,3 +2269,9 @@ Swap_Flags_Bits :: enum {
|
||||
PREFER = log2(0x8000),
|
||||
DISCARD = log2(0x10000),
|
||||
}
|
||||
|
||||
Eventfd_Flags_Bits :: enum {
|
||||
SEMAPHORE,
|
||||
CLOEXEC = auto_cast Open_Flags_Bits.CLOEXEC,
|
||||
NONBLOCK = auto_cast Open_Flags_Bits.NONBLOCK,
|
||||
}
|
||||
|
||||
@@ -3001,7 +3001,10 @@ timerfd_create :: proc "contextless" (clock_id: Clock_Id, flags: Open_Flags) ->
|
||||
return errno_unwrap2(ret, Fd)
|
||||
}
|
||||
|
||||
// TODO(flysand): eventfd
|
||||
eventfd :: proc "contextless" (initval: u32, flags: Eventfd_Flags) -> (Fd, Errno) {
|
||||
ret := syscall(SYS_eventfd2, initval, transmute(i32)flags)
|
||||
return errno_unwrap2(ret, Fd)
|
||||
}
|
||||
|
||||
// TODO(flysand): fallocate
|
||||
|
||||
|
||||
@@ -1748,3 +1748,5 @@ Mount_Flags :: bit_set[Mount_Flags_Bits; uint]
|
||||
Umount2_Flags :: bit_set[Umount2_Flags_Bits; u32]
|
||||
|
||||
Swap_Flags :: bit_set[Swap_Flags_Bits; u32]
|
||||
|
||||
Eventfd_Flags :: bit_set[Eventfd_Flags_Bits; i32]
|
||||
|
||||
Reference in New Issue
Block a user