diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-01-01 17:46:15 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-01 17:46:15 +0000 |
| commit | 8a5c1b109d529d80a559147258e7d6b173ce52ad (patch) | |
| tree | bb1ac23106f57679f42daeb6d6c9fa2b83d42461 /core/sys/linux | |
| parent | bfbcc02affc9193600a7571d07523a9095efc0d5 (diff) | |
| parent | 28e226381d3ebe20b70d13c0ea46a7183d59d65e (diff) | |
Merge pull request #4613 from fnknda/fix-linux-bind
Fix calls to bind always returning EINVAL when using linux.Sock_Addr_In
Diffstat (limited to 'core/sys/linux')
| -rw-r--r-- | core/sys/linux/types.odin | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/sys/linux/types.odin b/core/sys/linux/types.odin index 42d5cc988..08a443bcc 100644 --- a/core/sys/linux/types.odin +++ b/core/sys/linux/types.odin @@ -685,12 +685,21 @@ Address_Family :: distinct Protocol_Family Socket_Msg :: bit_set[Socket_Msg_Bits; i32] /* + Struct representing a generic socket address. +*/ +Sock_Addr :: struct #packed { + sa_family: Address_Family, + sa_data: [14]u8, +} + +/* Struct representing IPv4 socket address. */ Sock_Addr_In :: struct #packed { sin_family: Address_Family, sin_port: u16be, sin_addr: [4]u8, + sin_zero: [size_of(Sock_Addr) - size_of(Address_Family) - size_of(u16be) - size_of([4]u8)]u8, } /* @@ -720,6 +729,7 @@ Sock_Addr_Any :: struct #raw_union { family: Address_Family, port: u16be, }, + using generic: Sock_Addr, using ipv4: Sock_Addr_In, using ipv6: Sock_Addr_In6, using uds: Sock_Addr_Un, |