Implement Linux POSIX compliance for poll, sched, sys/select. Fix enum in fcntl.

This commit is contained in:
Isaac Andrade
2024-09-14 20:23:42 -06:00
parent aa91479870
commit 8616842ec6
4 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ O_Flag_Bits :: enum c.int {
// RSYNC = O_RSYNC, // RSYNC = O_RSYNC,
// Execute only. // Execute only.
EXEC = log2(O_EXEC), EXEC = O_EXEC when ODIN_OS == .Linux else log2(O_EXEC),
// Reading and writing. // Reading and writing.
RDWR = log2(O_RDWR), RDWR = log2(O_RDWR),
// Writing only. // Writing only.
+3 -3
View File
@@ -27,9 +27,9 @@ foreign lib {
nfds_t :: c.uint nfds_t :: c.uint
Poll_Error :: enum c.int { Poll_Error :: enum c.int {
EAGAIN = Errno.EAGAIN, EAGAIN = cast(c.int)Errno.EAGAIN,
EINTR = Errno.EINTR, EINTR = cast(c.int)Errno.EINTR,
EINVAL = Errno.EINVAL, EINVAL = cast(c.int)Errno.EINVAL,
} }
Poll_Event_Bits :: enum c.short { Poll_Event_Bits :: enum c.short {
+1 -1
View File
@@ -94,7 +94,7 @@ when ODIN_OS == .Darwin {
SCHED_RR :: 3 SCHED_RR :: 3
SCHED_OTHER :: 2 SCHED_OTHER :: 2
} else when ODIN_OS == .NetBSD { } else when ODIN_OS == .NetBSD || ODIN_OS == .Linux {
SCHED_OTHER :: 0 SCHED_OTHER :: 0
SCHED_FIFO :: 1 SCHED_FIFO :: 1
+1 -1
View File
@@ -55,7 +55,7 @@ when ODIN_OS == .NetBSD {
LSELECT :: "select" LSELECT :: "select"
} }
when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS == .OpenBSD { when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS == .OpenBSD || ODIN_OS == .Linux {
suseconds_t :: distinct (c.int32_t when ODIN_OS == .Darwin || ODIN_OS == .NetBSD else c.long) suseconds_t :: distinct (c.int32_t when ODIN_OS == .Darwin || ODIN_OS == .NetBSD else c.long)