diff options
| author | Harold Brenes <harold@hbrenes.com> | 2025-12-20 16:55:06 -0500 |
|---|---|---|
| committer | Harold Brenes <harold@hbrenes.com> | 2025-12-20 16:55:06 -0500 |
| commit | eda6e64639fcbbc0849a413d9cc22f7d8d9107f9 (patch) | |
| tree | ed7ee4d2092e6cce66f37d7c9117da6520d999bb | |
| parent | 7640a0511fc7baf8bc3f375a90b3d30616c703f0 (diff) | |
Fix nfds_t alias for Linux
| -rw-r--r-- | core/sys/posix/poll.odin | 2 | ||||
| -rw-r--r-- | tests/core/sys/posix/structs/structs.c | 1 | ||||
| -rw-r--r-- | tests/core/sys/posix/structs/structs.odin | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/core/sys/posix/poll.odin b/core/sys/posix/poll.odin index a9e582b51..bb400c5a9 100644 --- a/core/sys/posix/poll.odin +++ b/core/sys/posix/poll.odin @@ -25,7 +25,7 @@ foreign lib { poll :: proc(fds: [^]pollfd, nfds: nfds_t, timeout: c.int) -> c.int --- } -when ODIN_OS == .Haiku { +when ODIN_OS == .Haiku || ODIN_OS == .Linux { nfds_t :: c.ulong } else { nfds_t :: c.uint diff --git a/tests/core/sys/posix/structs/structs.c b/tests/core/sys/posix/structs/structs.c index ac771057e..6bb7df29e 100644 --- a/tests/core/sys/posix/structs/structs.c +++ b/tests/core/sys/posix/structs/structs.c @@ -74,6 +74,7 @@ int main(int argc, char *argv[]) printf("ai_canonname %zu\n", offsetof(struct addrinfo, ai_canonname)); printf("pollfd %zu %zu\n", sizeof(struct pollfd), _Alignof(struct pollfd)); + printf("nfds_t %zu %zu\n", sizeof(nfds_t), _Alignof(nfds_t)); printf("passwd %zu %zu\n", sizeof(struct passwd), _Alignof(struct passwd)); diff --git a/tests/core/sys/posix/structs/structs.odin b/tests/core/sys/posix/structs/structs.odin index 55369e386..64833c437 100644 --- a/tests/core/sys/posix/structs/structs.odin +++ b/tests/core/sys/posix/structs/structs.odin @@ -41,6 +41,8 @@ main :: proc() { fmt.println("ai_canonname", offset_of(posix.addrinfo, ai_canonname)) fmt.println("pollfd", size_of(posix.pollfd), align_of(posix.pollfd)) + fmt.println("nfds_t", size_of(posix.nfds_t), align_of(posix.nfds_t)) + fmt.println("passwd", size_of(posix.passwd), align_of(posix.passwd)) when ODIN_OS != .Haiku { |