diff --git a/lib/std/c/darwin.zig b/lib/std/c/darwin.zig index 8bb30efab3..b85a5bc40f 100644 --- a/lib/std/c/darwin.zig +++ b/lib/std/c/darwin.zig @@ -291,6 +291,7 @@ pub const sockaddr = extern struct { family: sa_family_t, data: [14]u8, + pub const SS_MAXSIZE = 128; pub const storage = std.x.os.Socket.Address.Native.Storage; pub const in = extern struct { len: u8 = @sizeOf(in), diff --git a/lib/std/c/dragonfly.zig b/lib/std/c/dragonfly.zig index 35bbeac6a3..a2b7e31b4f 100644 --- a/lib/std/c/dragonfly.zig +++ b/lib/std/c/dragonfly.zig @@ -465,6 +465,7 @@ pub const sockaddr = extern struct { family: u8, data: [14]u8, + pub const SS_MAXSIZE = 128; pub const storage = std.x.os.Socket.Address.Native.Storage; pub const in = extern struct { diff --git a/lib/std/c/freebsd.zig b/lib/std/c/freebsd.zig index f65af3f915..ecc9690069 100644 --- a/lib/std/c/freebsd.zig +++ b/lib/std/c/freebsd.zig @@ -323,6 +323,7 @@ pub const sockaddr = extern struct { /// actually longer; address value data: [14]u8, + pub const SS_MAXSIZE = 128; pub const storage = std.x.os.Socket.Address.Native.Storage; pub const in = extern struct { diff --git a/lib/std/c/haiku.zig b/lib/std/c/haiku.zig index 1ad51cfadd..dcebeea95e 100644 --- a/lib/std/c/haiku.zig +++ b/lib/std/c/haiku.zig @@ -339,6 +339,7 @@ pub const sockaddr = extern struct { /// actually longer; address value data: [14]u8, + pub const SS_MAXSIZE = 128; pub const storage = std.x.os.Socket.Address.Native.Storage; pub const in = extern struct { diff --git a/lib/std/c/netbsd.zig b/lib/std/c/netbsd.zig index d76a9ecdf5..042d540bcc 100644 --- a/lib/std/c/netbsd.zig +++ b/lib/std/c/netbsd.zig @@ -476,6 +476,7 @@ pub const sockaddr = extern struct { /// actually longer; address value data: [14]u8, + pub const SS_MAXSIZE = 128; pub const storage = std.x.os.Socket.Address.Native.Storage; pub const in = extern struct { diff --git a/lib/std/c/openbsd.zig b/lib/std/c/openbsd.zig index b3919d4724..39425b5e0e 100644 --- a/lib/std/c/openbsd.zig +++ b/lib/std/c/openbsd.zig @@ -279,6 +279,7 @@ pub const sockaddr = extern struct { /// actually longer; address value data: [14]u8, + pub const SS_MAXSIZE = 256; pub const storage = std.x.os.Socket.Address.Native.Storage; pub const in = extern struct { diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index df7166a4ff..2ea127a522 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -2923,6 +2923,7 @@ pub const sockaddr = extern struct { family: sa_family_t, data: [14]u8, + pub const SS_MAXSIZE = 128; pub const storage = std.x.os.Socket.Address.Native.Storage; /// IPv4 socket address diff --git a/lib/std/os/windows/ws2_32.zig b/lib/std/os/windows/ws2_32.zig index 168a098397..a6eb9e07ff 100644 --- a/lib/std/os/windows/ws2_32.zig +++ b/lib/std/os/windows/ws2_32.zig @@ -1105,6 +1105,7 @@ pub const sockaddr = extern struct { family: ADDRESS_FAMILY, data: [14]u8, + pub const SS_MAXSIZE = 128; pub const storage = std.x.os.Socket.Address.Native.Storage; /// IPv4 socket address diff --git a/lib/std/x/os/socket.zig b/lib/std/x/os/socket.zig index 5930b8cb9a..529fd19598 100644 --- a/lib/std/x/os/socket.zig +++ b/lib/std/x/os/socket.zig @@ -37,7 +37,7 @@ pub const Socket = struct { /// POSIX `sockaddr.storage`. The expected size and alignment is specified in IETF RFC 2553. pub const Storage = extern struct { - pub const expected_size = 128; + pub const expected_size = os.sockaddr.SS_MAXSIZE; pub const expected_alignment = 8; pub const padding_size = expected_size -