Documentation
¶
Overview ¶
Package bsd provides Go type definitions for POSIX/BSD C structs used in the generated macOS C library bindings. These types are absent from Apple's SDK metadata (they originate from Darwin system headers, not framework headers), so they are defined here and imported by generated packages that reference them in function signatures.
Field layouts match the Darwin arm64 ABI so that unsafe pointer casts in generated CGo bridge code are well-defined.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtherAddr ¶
type EtherAddr [6]uint8
EtherAddr is a 48-bit Ethernet hardware address. Corresponds to POSIX struct ether_addr { u_char octet[6]; }.
type In6Addr ¶
type In6Addr [16]uint8
In6Addr is a 128-bit IPv6 address. Corresponds to POSIX struct in6_addr { uint8_t s6_addr[16]; }.
type InAddr ¶
type InAddr struct {
S_addr uint32
}
InAddr is a 32-bit IPv4 address. Corresponds to POSIX struct in_addr { uint32_t s_addr; }.
type Iovec ¶
type Iovec struct {
Base unsafe.Pointer // iov_base: pointer to buffer
Len uint64 // iov_len: length of buffer (size_t on arm64)
}
Iovec is a scatter/gather I/O vector. Corresponds to POSIX struct iovec { void *iov_base; size_t iov_len; }. On Darwin arm64: iov_base is 8 bytes, iov_len (size_t) is 8 bytes = 16 bytes total.
type Timespec ¶
Timespec is a time value with nanosecond precision. Corresponds to POSIX struct timespec { time_t tv_sec; long tv_nsec; }. On Darwin arm64 both fields are int64 (16 bytes total).
type Timeval ¶
type Timeval struct {
Sec int64 // tv_sec: seconds
Usec int32 // tv_usec: microseconds
// contains filtered or unexported fields
}
Timeval is a time value with microsecond precision. Corresponds to POSIX struct timeval { time_t tv_sec; suseconds_t tv_usec; }. On Darwin arm64: tv_sec is int64 (8 bytes), tv_usec is int32 (4 bytes), with 4 bytes of trailing padding giving sizeof == 16.