Source
pub const addrinfo = if (builtin.abi.isAndroid()) extern struct {
flags: AI,
family: i32,
socktype: i32,
protocol: i32,
addrlen: socklen_t,
canonname: ?[*:0]u8,
addr: ?*sockaddr,
next: ?*addrinfo,
} else switch (native_os) {
.linux, .emscripten => linux.addrinfo,
.windows => ws2_32.addrinfo,
.freebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
flags: AI,
family: i32,
socktype: i32,
protocol: i32,
addrlen: socklen_t,
canonname: ?[*:0]u8,
addr: ?*sockaddr,
next: ?*addrinfo,
},
.solaris, .illumos => extern struct {
flags: AI,
family: i32,
socktype: i32,
protocol: i32,
addrlen: socklen_t,
canonname: ?[*:0]u8,
addr: ?*sockaddr,
next: ?*addrinfo,
},
.netbsd => extern struct {
flags: AI,
family: i32,
socktype: i32,
protocol: i32,
addrlen: socklen_t,
canonname: ?[*:0]u8,
addr: ?*sockaddr,
next: ?*addrinfo,
},
.dragonfly => extern struct {
flags: AI,
family: i32,
socktype: i32,
protocol: i32,
addrlen: socklen_t,
canonname: ?[*:0]u8,
addr: ?*sockaddr,
next: ?*addrinfo,
},
.haiku => extern struct {
flags: AI,
family: i32,
socktype: i32,
protocol: i32,
addrlen: socklen_t,
canonname: ?[*:0]u8,
addr: ?*sockaddr,
next: ?*addrinfo,
},
// https://github.com/SerenityOS/serenity/blob/d510d2aeb2facbd8f6c383d70fd1b033e1fee5dd/Userland/Libraries/LibC/netdb.h#L66-L75
.openbsd, .serenity => extern struct {
flags: AI,
family: c_int,
socktype: c_int,
protocol: c_int,
addrlen: socklen_t,
addr: ?*sockaddr,
canonname: ?[*:0]u8,
next: ?*addrinfo,
},
else => void,
}