core:sys/linux - flags, spacing, inotify_init

This commit is contained in:
A1029384756
2024-12-01 11:54:54 +11:00
committed by flysand7
parent f6b0ea160b
commit 59adcf6c46
4 changed files with 37 additions and 23 deletions
+7 -8
View File
@@ -2537,8 +2537,13 @@ waitid :: proc "contextless" (id_type: Id_Type, id: Id, sig_info: ^Sig_Info, opt
// TODO(flysand): ioprio_get
inotify_init :: proc "contextless" () -> (Fd, Errno) {
ret := syscall(SYS_inotify_init)
return errno_unwrap(ret, Fd)
when ODIN_ARCH == .arm64 || ODIN_ARCH == .riscv64 {
ret := syscall(SYS_inotify_init1, 0)
return errno_unwrap(ret, Fd)
} else {
ret := syscall(SYS_inotify_init)
return errno_unwrap(ret, Fd)
}
}
inotify_init1 :: proc "contextless" (flags: Inotify_Init_Flags) -> (Fd, Errno) {
@@ -2556,12 +2561,6 @@ inotify_rm_watch :: proc "contextless" (fd: Fd, wd: Wd) -> (Errno) {
return Errno(-ret)
}
// helper procedure to access the data within an `Inotify_Event`
// since Odin doesn't have an alternative to `__flexarr`
inotify_event_name :: proc "contextless" (event: ^Inotify_Event) -> cstring {
return transmute(cstring)uintptr(&event.name)
}
// TODO(flysand): migrate_pages
/*