aboutsummaryrefslogtreecommitdiff
path: root/core/sys
diff options
context:
space:
mode:
authorJoao Fukuda <joao@fukuda.sh>2024-12-22 15:53:54 -0300
committerJoao Fukuda <joao@fukuda.sh>2024-12-22 15:53:54 -0300
commit0a2200fa12c2255d03f366fe301228a147ed79e5 (patch)
treef59882e3162a0620ddab80e9e4c20674694ce438 /core/sys
parent597fba7c31f5e927b0c7431444dad132352b4046 (diff)
Fix issue #4612
Diffstat (limited to 'core/sys')
-rw-r--r--core/sys/linux/types.odin11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/sys/linux/types.odin b/core/sys/linux/types.odin
index 42d5cc988..dc3e4018d 100644
--- a/core/sys/linux/types.odin
+++ b/core/sys/linux/types.odin
@@ -684,6 +684,15 @@ 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.
*/
@@ -691,6 +700,7 @@ 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 +730,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,