diff --git a/core/sys/posix/fcntl.odin b/core/sys/posix/fcntl.odin index bb2e6835bbc..d48e39d02b7 100644 --- a/core/sys/posix/fcntl.odin +++ b/core/sys/posix/fcntl.odin @@ -128,7 +128,7 @@ O_Flag_Bits :: enum c.int { // RSYNC = O_RSYNC, // Execute only. - EXEC = log2(O_EXEC), + EXEC = O_EXEC when ODIN_OS == .Linux else log2(O_EXEC), // Reading and writing. RDWR = log2(O_RDWR), // Writing only. @@ -177,7 +177,7 @@ when ODIN_OS == .Darwin { O_DIRECTORY :: 0x00100000 O_EXCL :: 0x00000800 O_NOCTTY :: 0x00020000 - O_NOFOLLOW :: 0x00000100 + O_NOFOLLOW :: 0x00000100 O_TRUNC :: 0x00000400 _O_TTY_INIT :: 0 @@ -242,7 +242,7 @@ when ODIN_OS == .Darwin { O_DIRECTORY :: 0x00020000 O_EXCL :: 0x0800 O_NOCTTY :: 0x8000 - O_NOFOLLOW :: 0x0100 + O_NOFOLLOW :: 0x0100 O_TRUNC :: 0x0400 _O_TTY_INIT :: 0x00080000 @@ -307,7 +307,7 @@ when ODIN_OS == .Darwin { O_DIRECTORY :: 0x0020000 O_EXCL :: 0x0800 O_NOCTTY :: 0x8000 - O_NOFOLLOW :: 0x0100 + O_NOFOLLOW :: 0x0100 O_TRUNC :: 0x0400 _O_TTY_INIT :: 0 @@ -372,7 +372,7 @@ when ODIN_OS == .Darwin { O_DIRECTORY :: 0x20000 O_EXCL :: 0x0800 O_NOCTTY :: 0x8000 - O_NOFOLLOW :: 0x0100 + O_NOFOLLOW :: 0x0100 O_TRUNC :: 0x0400 _O_TTY_INIT :: 0 diff --git a/core/sys/posix/poll.odin b/core/sys/posix/poll.odin index 7f23de2673d..3d403d6255f 100644 --- a/core/sys/posix/poll.odin +++ b/core/sys/posix/poll.odin @@ -27,9 +27,9 @@ foreign lib { nfds_t :: c.uint Poll_Error :: enum c.int { - EAGAIN = Errno.EAGAIN, - EINTR = Errno.EINTR, - EINVAL = Errno.EINVAL, + EAGAIN = cast(c.int)Errno.EAGAIN, + EINTR = cast(c.int)Errno.EINTR, + EINVAL = cast(c.int)Errno.EINVAL, } Poll_Event_Bits :: enum c.short { diff --git a/core/sys/posix/sched.odin b/core/sys/posix/sched.odin index 6623ba6e68b..3923257aa9f 100644 --- a/core/sys/posix/sched.odin +++ b/core/sys/posix/sched.odin @@ -94,7 +94,7 @@ when ODIN_OS == .Darwin { SCHED_RR :: 3 SCHED_OTHER :: 2 -} else when ODIN_OS == .NetBSD { +} else when ODIN_OS == .NetBSD || ODIN_OS == .Linux { SCHED_OTHER :: 0 SCHED_FIFO :: 1 diff --git a/core/sys/posix/sys_select.odin b/core/sys/posix/sys_select.odin index 3392e02bc06..c20636b2163 100644 --- a/core/sys/posix/sys_select.odin +++ b/core/sys/posix/sys_select.odin @@ -55,7 +55,7 @@ when ODIN_OS == .NetBSD { 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)