Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions core/sys/linux/sys.odin
Original file line number Diff line number Diff line change
Expand Up @@ -2477,18 +2477,8 @@ exit_group :: proc "contextless" (code: i32) -> ! {
Available since Linux 2.6.
*/
epoll_wait :: proc(epfd: Fd, events: [^]EPoll_Event, count: i32, timeout: i32) -> (i32, Errno) {
when ODIN_ARCH != .arm64 && ODIN_ARCH != .riscv64 {
ret := syscall(SYS_epoll_wait, epfd, events, count, timeout)
return errno_unwrap(ret, i32)
} else {
// Convert milliseconds to nanosecond timespec
timeout_ns := Time_Spec {
time_sec = uint(timeout * 1000),
time_nsec = 0,
}
ret := syscall(SYS_epoll_pwait, epfd, events, count, &timeout_ns, rawptr(nil))
return errno_unwrap(ret, i32)
}
ret := syscall(SYS_epoll_pwait, epfd, events, count, timeout, rawptr(nil))
return errno_unwrap(ret, i32)
}

/*
Expand Down
13 changes: 10 additions & 3 deletions core/sys/linux/types.odin
Original file line number Diff line number Diff line change
Expand Up @@ -1446,9 +1446,16 @@ EPoll_Data :: struct #raw_union {
u64: u64,
}

EPoll_Event :: struct #packed {
events: EPoll_Event_Set,
data: EPoll_Data,
when ODIN_ARCH == .amd64 || ODIN_ARCH == .i386 {
EPoll_Event :: struct #packed {
events: EPoll_Event_Set,
data: EPoll_Data,
}
} else {
EPoll_Event :: struct {
events: EPoll_Event_Set,
data: EPoll_Data,
}
}

/*
Expand Down
Loading