pub const O_CREAT: u32 = 64;
pub const O_EXCL: u32 = 128;
pub const O_NOCTTY: u32 = 256;
pub const O_TRUNC: u32 = 512;
pub const O_APPEND: u32 = 1024;
pub const O_NONBLOCK: u32 = 2048;
pub const O_DSYNC: u32 = 4096;
pub const O_SYNC: u32 = 1052672;
pub const O_RSYNC: u32 = 1052672;
pub const O_DIRECTORY: u32 = 65536;
pub const O_NOFOLLOW: u32 = 131072;
pub const O_CLOEXEC: u32 = 524288;
pub const O_ASYNC: u32 = 8192;
pub const O_DIRECT: u32 = 16384;
pub const O_LARGEFILE: u32 = 32768;
pub const O_NOATIME: u32 = 262144;
pub const O_PATH: u32 = 2097152;
pub const O_TMPFILE: u32 = 4259840;
pub const O_NDELAY: u32 = 2048;
pub const O_SEARCH: u32 = 2097152;
pub const O_EXEC: u32 = 2097152;
pub const O_TTY_INIT: u32 = 0;
pub const O_ACCMODE: u32 = 2097155;
pub const O_RDONLY: u32 = 0;
pub const O_WRONLY: u32 = 1;
pub const O_RDWR: u32 = 2;
pub const F_DUPFD: u32 = 0;
pub const F_GETFD: u32 = 1;
pub const F_SETFD: u32 = 2;
pub const F_GETFL: u32 = 3;
pub const F_SETFL: u32 = 4;
pub const F_SETOWN: u32 = 8;
pub const F_GETOWN: u32 = 9;
pub const F_SETSIG: u32 = 10;
pub const F_GETSIG: u32 = 11;
pub const F_GETLK: u32 = 5;
pub const F_SETLK: u32 = 6;
pub const F_SETLKW: u32 = 7;
pub const FD_CLOEXEC: u32 = 1;
pub const F_DUPFD_CLOEXEC: u32 = 1030;
pub const F_RDLCK: u32 = 0;
pub const F_WRLCK: u32 = 1;
pub const F_UNLCK: u32 = 2;
pub const F_OK: u32 = 0;
pub const F_ULOCK: u32 = 0;
pub const F_LOCK: u32 = 1;
pub const F_TLOCK: u32 = 2;
pub const F_TEST: u32 = 3;
pub const SOCK_STREAM: u32 = 1;
pub const SOCK_DGRAM: u32 = 2;
pub const SOCK_RAW: u32 = 3;
pub const SOCK_RDM: u32 = 4;
pub const SOCK_SEQPACKET: u32 = 5;
pub const SOCK_DCCP: u32 = 6;
pub const SOCK_PACKET: u32 = 10;
pub const SOCK_CLOEXEC: u32 = 524288;
pub const SOCK_NONBLOCK: u32 = 2048;
pub const AF_UNSPEC: u32 = 0;
pub const AF_LOCAL: u32 = 1;
pub const AF_UNIX: u32 = 1;
pub const AF_FILE: u32 = 1;
pub const AF_INET: u32 = 2;
pub const AF_AX25: u32 = 3;
pub const AF_IPX: u32 = 4;
pub const AF_APPLETALK: u32 = 5;
pub const AF_NETROM: u32 = 6;
pub const AF_BRIDGE: u32 = 7;
pub const AF_ATMPVC: u32 = 8;
pub const AF_X25: u32 = 9;
pub const AF_INET6: u32 = 10;
pub const AF_ROSE: u32 = 11;
pub const AF_DECnet: u32 = 12;
pub const AF_NETBEUI: u32 = 13;
pub const AF_SECURITY: u32 = 14;
pub const AF_KEY: u32 = 15;
pub const AF_NETLINK: u32 = 16;
pub const AF_ROUTE: u32 = 16;
pub const AF_PACKET: u32 = 17;
pub const AF_ASH: u32 = 18;
pub const AF_ECONET: u32 = 19;
pub const AF_ATMSVC: u32 = 20;
pub const AF_RDS: u32 = 21;
pub const AF_SNA: u32 = 22;
pub const AF_IRDA: u32 = 23;
pub const AF_PPPOX: u32 = 24;
pub const AF_WANPIPE: u32 = 25;
pub const AF_LLC: u32 = 26;
pub const AF_IB: u32 = 27;
pub const AF_MPLS: u32 = 28;
pub const AF_CAN: u32 = 29;
pub const AF_TIPC: u32 = 30;
pub const AF_BLUETOOTH: u32 = 31;
pub const AF_IUCV: u32 = 32;
pub const AF_RXRPC: u32 = 33;
pub const AF_ISDN: u32 = 34;
pub const AF_PHONET: u32 = 35;
pub const AF_IEEE802154: u32 = 36;
pub const AF_CAIF: u32 = 37;
pub const AF_ALG: u32 = 38;
pub const AF_NFC: u32 = 39;
pub const AF_VSOCK: u32 = 40;
pub const AF_KCM: u32 = 41;
pub const AF_QIPCRTR: u32 = 42;
pub const AF_SMC: u32 = 43;
pub const AF_XDP: u32 = 44;
pub const AF_MAX: u32 = 45;
pub const IPPROTO_IP: u32 = 0;
pub const IPPROTO_HOPOPTS: u32 = 0;
pub const IPPROTO_ICMP: u32 = 1;
pub const IPPROTO_IGMP: u32 = 2;
pub const IPPROTO_IPIP: u32 = 4;
pub const IPPROTO_TCP: u32 = 6;
pub const IPPROTO_EGP: u32 = 8;
pub const IPPROTO_PUP: u32 = 12;
pub const IPPROTO_UDP: u32 = 17;
pub const IPPROTO_IDP: u32 = 22;
pub const IPPROTO_TP: u32 = 29;
pub const IPPROTO_DCCP: u32 = 33;
pub const IPPROTO_IPV6: u32 = 41;
pub const IPPROTO_ROUTING: u32 = 43;
pub const IPPROTO_FRAGMENT: u32 = 44;
pub const IPPROTO_RSVP: u32 = 46;
pub const IPPROTO_GRE: u32 = 47;
pub const IPPROTO_ESP: u32 = 50;
pub const IPPROTO_AH: u32 = 51;
pub const IPPROTO_ICMPV6: u32 = 58;
pub const IPPROTO_NONE: u32 = 59;
pub const IPPROTO_DSTOPTS: u32 = 60;
pub const IPPROTO_MTP: u32 = 92;
pub const IPPROTO_BEETPH: u32 = 94;
pub const IPPROTO_ENCAP: u32 = 98;
pub const IPPROTO_PIM: u32 = 103;
pub const IPPROTO_COMP: u32 = 108;
pub const IPPROTO_SCTP: u32 = 132;
pub const IPPROTO_MH: u32 = 135;
pub const IPPROTO_UDPLITE: u32 = 136;
pub const IPPROTO_MPLS: u32 = 137;
pub const IPPROTO_ETHERNET: u32 = 143;
pub const IPPROTO_RAW: u32 = 255;
pub const IPPROTO_MPTCP: u32 = 262;
pub const IPPROTO_MAX: u32 = 263;
pub const EAI_BADFLAGS: i32 = -1;
pub const EAI_NONAME: i32 = -2;
pub const EAI_AGAIN: i32 = -3;
pub const EAI_FAIL: i32 = -4;
pub const EAI_FAMILY: i32 = -6;
pub const EAI_SOCKTYPE: i32 = -7;
pub const EAI_SERVICE: i32 = -8;
pub const EAI_MEMORY: i32 = -10;
pub const EAI_SYSTEM: i32 = -11;
pub const EAI_OVERFLOW: i32 = -12;
pub const MAXADDRS: u32 = 48;
pub const EPOLL_CLOEXEC: u32 = 524288;
pub const EPOLL_NONBLOCK: u32 = 2048;
pub const EPOLLIN: u32 = 1;
pub const EPOLLPRI: u32 = 2;
pub const EPOLLOUT: u32 = 4;
pub const EPOLLRDNORM: u32 = 64;
pub const EPOLLNVAL: u32 = 32;
pub const EPOLLRDBAND: u32 = 128;
pub const EPOLLWRNORM: u32 = 256;
pub const EPOLLWRBAND: u32 = 512;
pub const EPOLLMSG: u32 = 1024;
pub const EPOLLERR: u32 = 8;
pub const EPOLLHUP: u32 = 16;
pub const EPOLLRDHUP: u32 = 8192;
pub const EPOLLEXCLUSIVE: u32 = 268435456;
pub const EPOLLWAKEUP: u32 = 536870912;
pub const EPOLLONESHOT: u32 = 1073741824;
pub const EPOLLET: u32 = 2147483648;
pub const EPOLL_CTL_ADD: u32 = 1;
pub const EPOLL_CTL_DEL: u32 = 2;
pub const EPOLL_CTL_MOD: u32 = 3;
pub const RLIMIT_CPU: u32 = 0;
pub const RLIMIT_FSIZE: u32 = 1;
pub const RLIMIT_DATA: u32 = 2;
pub const RLIMIT_STACK: u32 = 3;
pub const RLIMIT_CORE: u32 = 4;
pub const RLIMIT_RSS: u32 = 5;
pub const RLIMIT_NPROC: u32 = 6;
pub const RLIMIT_NOFILE: u32 = 7;
pub const RLIMIT_MEMLOCK: u32 = 8;
pub const RLIMIT_AS: u32 = 9;
pub const RLIMIT_LOCKS: u32 = 10;
pub const RLIMIT_SIGPENDING: u32 = 11;
pub const RLIMIT_MSGQUEUE: u32 = 12;
pub const RLIMIT_NICE: u32 = 13;
pub const RLIMIT_RTPRIO: u32 = 14;
pub const RLIMIT_RTTIME: u32 = 15;
pub const RLIMIT_NLIMITS: u32 = 16;
pub const FD_SETSIZE: u32 = 1024;
pub const _SC_ARG_MAX: u32 = 0;
pub const _SC_CHILD_MAX: u32 = 1;
pub const _SC_CLK_TCK: u32 = 2;
pub const _SC_NGROUPS_MAX: u32 = 3;
pub const _SC_OPEN_MAX: u32 = 4;
pub const _SC_STREAM_MAX: u32 = 5;
pub const _SC_TZNAME_MAX: u32 = 6;
pub const _SC_JOB_CONTROL: u32 = 7;
pub const _SC_SAVED_IDS: u32 = 8;
pub const _SC_REALTIME_SIGNALS: u32 = 9;
pub const _SC_PRIORITY_SCHEDULING: u32 = 10;
pub const _SC_TIMERS: u32 = 11;
pub const _SC_ASYNCHRONOUS_IO: u32 = 12;
pub const _SC_PRIORITIZED_IO: u32 = 13;
pub const _SC_SYNCHRONIZED_IO: u32 = 14;
pub const _SC_FSYNC: u32 = 15;
pub const _SC_MAPPED_FILES: u32 = 16;
pub const _SC_MEMLOCK: u32 = 17;
pub const _SC_MEMLOCK_RANGE: u32 = 18;
pub const _SC_MEMORY_PROTECTION: u32 = 19;
pub const _SC_MESSAGE_PASSING: u32 = 20;
pub const _SC_SEMAPHORES: u32 = 21;
pub const _SC_SHARED_MEMORY_OBJECTS: u32 = 22;
pub const _SC_AIO_LISTIO_MAX: u32 = 23;
pub const _SC_AIO_MAX: u32 = 24;
pub const _SC_AIO_PRIO_DELTA_MAX: u32 = 25;
pub const _SC_DELAYTIMER_MAX: u32 = 26;
pub const _SC_MQ_OPEN_MAX: u32 = 27;
pub const _SC_MQ_PRIO_MAX: u32 = 28;
pub const _SC_VERSION: u32 = 29;
pub const _SC_PAGE_SIZE: u32 = 30;
pub const _SC_PAGESIZE: u32 = 30;
pub const _SC_RTSIG_MAX: u32 = 31;
pub const _SC_SEM_NSEMS_MAX: u32 = 32;
pub const _SC_SEM_VALUE_MAX: u32 = 33;
pub const _SC_SIGQUEUE_MAX: u32 = 34;
pub const _SC_TIMER_MAX: u32 = 35;
pub const _SC_BC_BASE_MAX: u32 = 36;
pub const _SC_BC_DIM_MAX: u32 = 37;
pub const _SC_BC_SCALE_MAX: u32 = 38;
pub const _SC_BC_STRING_MAX: u32 = 39;
pub const _SC_COLL_WEIGHTS_MAX: u32 = 40;
pub const _SC_EXPR_NEST_MAX: u32 = 42;
pub const _SC_LINE_MAX: u32 = 43;
pub const _SC_RE_DUP_MAX: u32 = 44;
pub const _SC_2_VERSION: u32 = 46;
pub const _SC_2_C_BIND: u32 = 47;
pub const _SC_2_C_DEV: u32 = 48;
pub const _SC_2_FORT_DEV: u32 = 49;
pub const _SC_2_FORT_RUN: u32 = 50;
pub const _SC_2_SW_DEV: u32 = 51;
pub const _SC_2_LOCALEDEF: u32 = 52;
pub const _SC_UIO_MAXIOV: u32 = 60;
pub const _SC_IOV_MAX: u32 = 60;
pub const _SC_THREADS: u32 = 67;
pub const _SC_THREAD_SAFE_FUNCTIONS: u32 = 68;
pub const _SC_GETGR_R_SIZE_MAX: u32 = 69;
pub const _SC_GETPW_R_SIZE_MAX: u32 = 70;
pub const _SC_LOGIN_NAME_MAX: u32 = 71;
pub const _SC_TTY_NAME_MAX: u32 = 72;
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: u32 = 73;
pub const _SC_THREAD_KEYS_MAX: u32 = 74;
pub const _SC_THREAD_STACK_MIN: u32 = 75;
pub const _SC_THREAD_THREADS_MAX: u32 = 76;
pub const _SC_THREAD_ATTR_STACKADDR: u32 = 77;
pub const _SC_THREAD_ATTR_STACKSIZE: u32 = 78;
pub const _SC_THREAD_PRIORITY_SCHEDULING: u32 = 79;
pub const _SC_THREAD_PRIO_INHERIT: u32 = 80;
pub const _SC_THREAD_PRIO_PROTECT: u32 = 81;
pub const _SC_THREAD_PROCESS_SHARED: u32 = 82;
pub const _SC_NPROCESSORS_CONF: u32 = 83;
pub const _SC_NPROCESSORS_ONLN: u32 = 84;
pub const _SC_PHYS_PAGES: u32 = 85;
pub const _SC_AVPHYS_PAGES: u32 = 86;
pub const _SC_ATEXIT_MAX: u32 = 87;
pub const _SC_PASS_MAX: u32 = 88;
pub const _SC_XOPEN_VERSION: u32 = 89;
pub const _SC_XOPEN_XCU_VERSION: u32 = 90;
pub const _SC_XOPEN_UNIX: u32 = 91;
pub const _SC_XOPEN_CRYPT: u32 = 92;
pub const _SC_XOPEN_ENH_I18N: u32 = 93;
pub const _SC_XOPEN_SHM: u32 = 94;
pub const _SC_2_CHAR_TERM: u32 = 95;
pub const _SC_2_UPE: u32 = 97;
pub const _SC_XOPEN_XPG2: u32 = 98;
pub const _SC_XOPEN_XPG3: u32 = 99;
pub const _SC_XOPEN_XPG4: u32 = 100;
pub const _SC_NZERO: u32 = 109;
pub const _SC_XBS5_ILP32_OFF32: u32 = 125;
pub const _SC_XBS5_ILP32_OFFBIG: u32 = 126;
pub const _SC_XBS5_LP64_OFF64: u32 = 127;
pub const _SC_XBS5_LPBIG_OFFBIG: u32 = 128;
pub const _SC_XOPEN_LEGACY: u32 = 129;
pub const _SC_XOPEN_REALTIME: u32 = 130;
pub const _SC_XOPEN_REALTIME_THREADS: u32 = 131;
pub const _SC_ADVISORY_INFO: u32 = 132;
pub const _SC_BARRIERS: u32 = 133;
pub const _SC_CLOCK_SELECTION: u32 = 137;
pub const _SC_CPUTIME: u32 = 138;
pub const _SC_THREAD_CPUTIME: u32 = 139;
pub const _SC_MONOTONIC_CLOCK: u32 = 149;
pub const _SC_READER_WRITER_LOCKS: u32 = 153;
pub const _SC_SPIN_LOCKS: u32 = 154;
pub const _SC_REGEXP: u32 = 155;
pub const _SC_SHELL: u32 = 157;
pub const _SC_SPAWN: u32 = 159;
pub const _SC_SPORADIC_SERVER: u32 = 160;
pub const _SC_THREAD_SPORADIC_SERVER: u32 = 161;
pub const _SC_TIMEOUTS: u32 = 164;
pub const _SC_TYPED_MEMORY_OBJECTS: u32 = 165;
pub const _SC_2_PBS: u32 = 168;
pub const _SC_2_PBS_ACCOUNTING: u32 = 169;
pub const _SC_2_PBS_LOCATE: u32 = 170;
pub const _SC_2_PBS_MESSAGE: u32 = 171;
pub const _SC_2_PBS_TRACK: u32 = 172;
pub const _SC_SYMLOOP_MAX: u32 = 173;
pub const _SC_STREAMS: u32 = 174;
pub const _SC_2_PBS_CHECKPOINT: u32 = 175;
pub const _SC_V6_ILP32_OFF32: u32 = 176;
pub const _SC_V6_ILP32_OFFBIG: u32 = 177;
pub const _SC_V6_LP64_OFF64: u32 = 178;
pub const _SC_V6_LPBIG_OFFBIG: u32 = 179;
pub const _SC_HOST_NAME_MAX: u32 = 180;
pub const _SC_TRACE: u32 = 181;
pub const _SC_TRACE_EVENT_FILTER: u32 = 182;
pub const _SC_TRACE_INHERIT: u32 = 183;
pub const _SC_TRACE_LOG: u32 = 184;
pub const _SC_IPV6: u32 = 235;
pub const _SC_RAW_SOCKETS: u32 = 236;
pub const _SC_V7_ILP32_OFF32: u32 = 237;
pub const _SC_V7_ILP32_OFFBIG: u32 = 238;
pub const _SC_V7_LP64_OFF64: u32 = 239;
pub const _SC_V7_LPBIG_OFFBIG: u32 = 240;
pub const _SC_SS_REPL_MAX: u32 = 241;
pub const _SC_TRACE_EVENT_NAME_MAX: u32 = 242;
pub const _SC_TRACE_NAME_MAX: u32 = 243;
pub const _SC_TRACE_SYS_MAX: u32 = 244;
pub const _SC_TRACE_USER_EVENT_MAX: u32 = 245;
pub const _SC_XOPEN_STREAMS: u32 = 246;
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: u32 = 247;
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: u32 = 248;
pub type size_t = usize;
pub type ssize_t = isize;
pub type clockid_t = ::core::ffi::c_int;
pub type mode_t = ::core::ffi::c_uint;
pub type nlink_t = u32;
pub type off_t = i64;
pub type ino_t = u64;
pub type dev_t = u64;
pub type blksize_t = ::core::ffi::c_long;
pub type blkcnt_t = i64;
pub type uid_t = ::core::ffi::c_uint;
pub type gid_t = ::core::ffi::c_uint;
pub type socklen_t = ::core::ffi::c_uint;
pub type sa_family_t = ::core::ffi::c_ushort;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct sockaddr {
pub sa_family: sa_family_t,
pub sa_data: [::core::ffi::c_char; 14usize],
}
#[test]
fn bindgen_test_layout_sockaddr() {
const UNINIT: ::core::mem::MaybeUninit<sockaddr> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<sockaddr>(),
16usize,
concat!("Size of: ", stringify!(sockaddr))
);
assert_eq!(
::core::mem::align_of::<sockaddr>(),
2usize,
concat!("Alignment of ", stringify!(sockaddr))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sa_family) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(sockaddr),
"::",
stringify!(sa_family)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sa_data) as usize - ptr as usize },
2usize,
concat!(
"Offset of field: ",
stringify!(sockaddr),
"::",
stringify!(sa_data)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sockaddr_storage {
pub ss_family: sa_family_t,
pub __ss_padding: [::core::ffi::c_char; 118usize],
pub __ss_align: ::core::ffi::c_ulong,
}
#[test]
fn bindgen_test_layout_sockaddr_storage() {
const UNINIT: ::core::mem::MaybeUninit<sockaddr_storage> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<sockaddr_storage>(),
128usize,
concat!("Size of: ", stringify!(sockaddr_storage))
);
assert_eq!(
::core::mem::align_of::<sockaddr_storage>(),
8usize,
concat!("Alignment of ", stringify!(sockaddr_storage))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ss_family) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_storage),
"::",
stringify!(ss_family)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__ss_padding) as usize - ptr as usize },
2usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_storage),
"::",
stringify!(__ss_padding)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__ss_align) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_storage),
"::",
stringify!(__ss_align)
)
);
}
impl Default for sockaddr_storage {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type in_port_t = u16;
pub type in_addr_t = u32;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct in_addr {
pub s_addr: in_addr_t,
}
#[test]
fn bindgen_test_layout_in_addr() {
const UNINIT: ::core::mem::MaybeUninit<in_addr> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<in_addr>(),
4usize,
concat!("Size of: ", stringify!(in_addr))
);
assert_eq!(
::core::mem::align_of::<in_addr>(),
4usize,
concat!("Alignment of ", stringify!(in_addr))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).s_addr) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(in_addr),
"::",
stringify!(s_addr)
)
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct sockaddr_in {
pub sin_family: sa_family_t,
pub sin_port: in_port_t,
pub sin_addr: in_addr,
pub sin_zero: [u8; 8usize],
}
#[test]
fn bindgen_test_layout_sockaddr_in() {
const UNINIT: ::core::mem::MaybeUninit<sockaddr_in> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<sockaddr_in>(),
16usize,
concat!("Size of: ", stringify!(sockaddr_in))
);
assert_eq!(
::core::mem::align_of::<sockaddr_in>(),
4usize,
concat!("Alignment of ", stringify!(sockaddr_in))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin_family) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_in),
"::",
stringify!(sin_family)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin_port) as usize - ptr as usize },
2usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_in),
"::",
stringify!(sin_port)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin_addr) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_in),
"::",
stringify!(sin_addr)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin_zero) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_in),
"::",
stringify!(sin_zero)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct in6_addr {
pub __in6_union: in6_addr__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union in6_addr__bindgen_ty_1 {
pub __s6_addr: [u8; 16usize],
pub __s6_addr16: [u16; 8usize],
pub __s6_addr32: [u32; 4usize],
}
#[test]
fn bindgen_test_layout_in6_addr__bindgen_ty_1() {
const UNINIT: ::core::mem::MaybeUninit<in6_addr__bindgen_ty_1> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<in6_addr__bindgen_ty_1>(),
16usize,
concat!("Size of: ", stringify!(in6_addr__bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<in6_addr__bindgen_ty_1>(),
4usize,
concat!("Alignment of ", stringify!(in6_addr__bindgen_ty_1))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__s6_addr) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(in6_addr__bindgen_ty_1),
"::",
stringify!(__s6_addr)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__s6_addr16) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(in6_addr__bindgen_ty_1),
"::",
stringify!(__s6_addr16)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__s6_addr32) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(in6_addr__bindgen_ty_1),
"::",
stringify!(__s6_addr32)
)
);
}
impl Default for in6_addr__bindgen_ty_1 {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[test]
fn bindgen_test_layout_in6_addr() {
const UNINIT: ::core::mem::MaybeUninit<in6_addr> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<in6_addr>(),
16usize,
concat!("Size of: ", stringify!(in6_addr))
);
assert_eq!(
::core::mem::align_of::<in6_addr>(),
4usize,
concat!("Alignment of ", stringify!(in6_addr))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__in6_union) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(in6_addr),
"::",
stringify!(__in6_union)
)
);
}
impl Default for in6_addr {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct sockaddr_in6 {
pub sin6_family: sa_family_t,
pub sin6_port: in_port_t,
pub sin6_flowinfo: u32,
pub sin6_addr: in6_addr,
pub sin6_scope_id: u32,
}
#[test]
fn bindgen_test_layout_sockaddr_in6() {
const UNINIT: ::core::mem::MaybeUninit<sockaddr_in6> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<sockaddr_in6>(),
28usize,
concat!("Size of: ", stringify!(sockaddr_in6))
);
assert_eq!(
::core::mem::align_of::<sockaddr_in6>(),
4usize,
concat!("Alignment of ", stringify!(sockaddr_in6))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin6_family) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_in6),
"::",
stringify!(sin6_family)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin6_port) as usize - ptr as usize },
2usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_in6),
"::",
stringify!(sin6_port)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin6_flowinfo) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_in6),
"::",
stringify!(sin6_flowinfo)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin6_addr) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_in6),
"::",
stringify!(sin6_addr)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin6_scope_id) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(sockaddr_in6),
"::",
stringify!(sin6_scope_id)
)
);
}
impl Default for sockaddr_in6 {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct addrinfo {
pub ai_flags: ::core::ffi::c_int,
pub ai_family: ::core::ffi::c_int,
pub ai_socktype: ::core::ffi::c_int,
pub ai_protocol: ::core::ffi::c_int,
pub ai_addrlen: socklen_t,
pub ai_addr: *mut sockaddr,
pub ai_canonname: *mut ::core::ffi::c_char,
pub ai_next: *mut addrinfo,
}
#[test]
fn bindgen_test_layout_addrinfo() {
const UNINIT: ::core::mem::MaybeUninit<addrinfo> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<addrinfo>(),
48usize,
concat!("Size of: ", stringify!(addrinfo))
);
assert_eq!(
::core::mem::align_of::<addrinfo>(),
8usize,
concat!("Alignment of ", stringify!(addrinfo))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ai_flags) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(addrinfo),
"::",
stringify!(ai_flags)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ai_family) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(addrinfo),
"::",
stringify!(ai_family)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ai_socktype) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(addrinfo),
"::",
stringify!(ai_socktype)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ai_protocol) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(addrinfo),
"::",
stringify!(ai_protocol)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ai_addrlen) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(addrinfo),
"::",
stringify!(ai_addrlen)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ai_addr) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(addrinfo),
"::",
stringify!(ai_addr)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ai_canonname) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(addrinfo),
"::",
stringify!(ai_canonname)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ai_next) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(addrinfo),
"::",
stringify!(ai_next)
)
);
}
impl Default for addrinfo {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct aibuf {
pub ai: addrinfo,
pub sa: aibuf_sa,
pub lock: [::core::ffi::c_int; 1usize],
pub slot: ::core::ffi::c_short,
pub ref_: ::core::ffi::c_short,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union aibuf_sa {
pub sin: sockaddr_in,
pub sin6: sockaddr_in6,
}
#[test]
fn bindgen_test_layout_aibuf_sa() {
const UNINIT: ::core::mem::MaybeUninit<aibuf_sa> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<aibuf_sa>(),
28usize,
concat!("Size of: ", stringify!(aibuf_sa))
);
assert_eq!(
::core::mem::align_of::<aibuf_sa>(),
4usize,
concat!("Alignment of ", stringify!(aibuf_sa))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(aibuf_sa),
"::",
stringify!(sin)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sin6) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(aibuf_sa),
"::",
stringify!(sin6)
)
);
}
impl Default for aibuf_sa {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[test]
fn bindgen_test_layout_aibuf() {
const UNINIT: ::core::mem::MaybeUninit<aibuf> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<aibuf>(),
88usize,
concat!("Size of: ", stringify!(aibuf))
);
assert_eq!(
::core::mem::align_of::<aibuf>(),
8usize,
concat!("Alignment of ", stringify!(aibuf))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ai) as usize - ptr as usize },
0usize,
concat!("Offset of field: ", stringify!(aibuf), "::", stringify!(ai))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sa) as usize - ptr as usize },
48usize,
concat!("Offset of field: ", stringify!(aibuf), "::", stringify!(sa))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).lock) as usize - ptr as usize },
76usize,
concat!(
"Offset of field: ",
stringify!(aibuf),
"::",
stringify!(lock)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).slot) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(aibuf),
"::",
stringify!(slot)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ref_) as usize - ptr as usize },
82usize,
concat!(
"Offset of field: ",
stringify!(aibuf),
"::",
stringify!(ref_)
)
);
}
impl Default for aibuf {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type time_t = ::core::ffi::c_longlong;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: ::core::ffi::c_long,
}
#[test]
fn bindgen_test_layout_timeval() {
const UNINIT: ::core::mem::MaybeUninit<timeval> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<timeval>(),
16usize,
concat!("Size of: ", stringify!(timeval))
);
assert_eq!(
::core::mem::align_of::<timeval>(),
8usize,
concat!("Alignment of ", stringify!(timeval))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(timeval),
"::",
stringify!(tv_sec)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(timeval),
"::",
stringify!(tv_usec)
)
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: ::core::ffi::c_long,
}
#[test]
fn bindgen_test_layout_timespec() {
const UNINIT: ::core::mem::MaybeUninit<timespec> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<timespec>(),
16usize,
concat!("Size of: ", stringify!(timespec))
);
assert_eq!(
::core::mem::align_of::<timespec>(),
8usize,
concat!("Alignment of ", stringify!(timespec))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(timespec),
"::",
stringify!(tv_sec)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(timespec),
"::",
stringify!(tv_nsec)
)
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct pthread_mutex_t {
pub __l: [::core::ffi::c_long; 6usize],
}
#[test]
fn bindgen_test_layout_pthread_mutex_t() {
const UNINIT: ::core::mem::MaybeUninit<pthread_mutex_t> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<pthread_mutex_t>(),
48usize,
concat!("Size of: ", stringify!(pthread_mutex_t))
);
assert_eq!(
::core::mem::align_of::<pthread_mutex_t>(),
8usize,
concat!("Alignment of ", stringify!(pthread_mutex_t))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__l) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutex_t),
"::",
stringify!(__l)
)
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct pthread_mutexattr_t {
pub __attr: ::core::ffi::c_uint,
}
#[test]
fn bindgen_test_layout_pthread_mutexattr_t() {
const UNINIT: ::core::mem::MaybeUninit<pthread_mutexattr_t> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<pthread_mutexattr_t>(),
4usize,
concat!("Size of: ", stringify!(pthread_mutexattr_t))
);
assert_eq!(
::core::mem::align_of::<pthread_mutexattr_t>(),
4usize,
concat!("Alignment of ", stringify!(pthread_mutexattr_t))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__attr) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_mutexattr_t),
"::",
stringify!(__attr)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct pthread_attr_t {
pub __u: pthread_attr_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union pthread_attr_t__bindgen_ty_1 {
pub __i: [::core::ffi::c_int; 14usize],
pub __vi: [::core::ffi::c_int; 14usize],
pub __s: [::core::ffi::c_ulong; 7usize],
}
#[test]
fn bindgen_test_layout_pthread_attr_t__bindgen_ty_1() {
const UNINIT: ::core::mem::MaybeUninit<pthread_attr_t__bindgen_ty_1> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<pthread_attr_t__bindgen_ty_1>(),
56usize,
concat!("Size of: ", stringify!(pthread_attr_t__bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<pthread_attr_t__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(pthread_attr_t__bindgen_ty_1))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__i) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_attr_t__bindgen_ty_1),
"::",
stringify!(__i)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__vi) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_attr_t__bindgen_ty_1),
"::",
stringify!(__vi)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__s) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_attr_t__bindgen_ty_1),
"::",
stringify!(__s)
)
);
}
impl Default for pthread_attr_t__bindgen_ty_1 {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[test]
fn bindgen_test_layout_pthread_attr_t() {
const UNINIT: ::core::mem::MaybeUninit<pthread_attr_t> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<pthread_attr_t>(),
56usize,
concat!("Size of: ", stringify!(pthread_attr_t))
);
assert_eq!(
::core::mem::align_of::<pthread_attr_t>(),
8usize,
concat!("Alignment of ", stringify!(pthread_attr_t))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).__u) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(pthread_attr_t),
"::",
stringify!(__u)
)
);
}
impl Default for pthread_attr_t {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type pthread_t = *mut ::core::ffi::c_void;
#[repr(C)]
#[derive(Copy, Clone)]
pub union epoll_data {
pub ptr: *mut ::core::ffi::c_void,
pub fd: ::core::ffi::c_int,
pub u32_: u32,
pub u64_: u64,
}
#[test]
fn bindgen_test_layout_epoll_data() {
const UNINIT: ::core::mem::MaybeUninit<epoll_data> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<epoll_data>(),
8usize,
concat!("Size of: ", stringify!(epoll_data))
);
assert_eq!(
::core::mem::align_of::<epoll_data>(),
8usize,
concat!("Alignment of ", stringify!(epoll_data))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(epoll_data),
"::",
stringify!(ptr)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).fd) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(epoll_data),
"::",
stringify!(fd)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).u32_) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(epoll_data),
"::",
stringify!(u32_)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).u64_) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(epoll_data),
"::",
stringify!(u64_)
)
);
}
impl Default for epoll_data {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type epoll_data_t = epoll_data;
#[repr(C, packed)]
#[derive(Copy, Clone)]
pub struct epoll_event {
pub events: u32,
pub data: epoll_data_t,
}
#[test]
fn bindgen_test_layout_epoll_event() {
const UNINIT: ::core::mem::MaybeUninit<epoll_event> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<epoll_event>(),
12usize,
concat!("Size of: ", stringify!(epoll_event))
);
assert_eq!(
::core::mem::align_of::<epoll_event>(),
1usize,
concat!("Alignment of ", stringify!(epoll_event))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).events) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(epoll_event),
"::",
stringify!(events)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(epoll_event),
"::",
stringify!(data)
)
);
}
impl Default for epoll_event {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type rlim_t = ::core::ffi::c_ulonglong;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct rlimit {
pub rlim_cur: rlim_t,
pub rlim_max: rlim_t,
}
#[test]
fn bindgen_test_layout_rlimit() {
const UNINIT: ::core::mem::MaybeUninit<rlimit> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<rlimit>(),
16usize,
concat!("Size of: ", stringify!(rlimit))
);
assert_eq!(
::core::mem::align_of::<rlimit>(),
8usize,
concat!("Alignment of ", stringify!(rlimit))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).rlim_cur) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(rlimit),
"::",
stringify!(rlim_cur)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).rlim_max) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(rlimit),
"::",
stringify!(rlim_max)
)
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct fd_set {
pub fds_bits: [::core::ffi::c_ulong; 16usize],
}
#[test]
fn bindgen_test_layout_fd_set() {
const UNINIT: ::core::mem::MaybeUninit<fd_set> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<fd_set>(),
128usize,
concat!("Size of: ", stringify!(fd_set))
);
assert_eq!(
::core::mem::align_of::<fd_set>(),
8usize,
concat!("Alignment of ", stringify!(fd_set))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(fd_set),
"::",
stringify!(fds_bits)
)
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct stat {
pub st_dev: dev_t,
pub st_ino: ino_t,
pub st_mode: mode_t,
pub st_nlink: nlink_t,
pub st_uid: uid_t,
pub st_gid: gid_t,
pub st_rdev: dev_t,
pub st_size: off_t,
pub st_blksize: blksize_t,
pub st_blocks: blkcnt_t,
pub st_atime: timespec,
pub st_mtime: timespec,
pub st_ctime: timespec,
}
#[test]
fn bindgen_test_layout_stat() {
const UNINIT: ::core::mem::MaybeUninit<stat> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<stat>(),
112usize,
concat!("Size of: ", stringify!(stat))
);
assert_eq!(
::core::mem::align_of::<stat>(),
8usize,
concat!("Alignment of ", stringify!(stat))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_dev) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_dev)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_ino) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_ino)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_mode) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_mode)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_nlink) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_nlink)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_uid) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_uid)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_gid) as usize - ptr as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_gid)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_rdev) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_rdev)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_size) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_size)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_blksize) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_blksize)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_blocks) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_blocks)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_atime) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_atime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_mtime) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_mtime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).st_ctime) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(stat),
"::",
stringify!(st_ctime)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct iovec {
pub iov_base: *mut ::core::ffi::c_void,
pub iov_len: size_t,
}
#[test]
fn bindgen_test_layout_iovec() {
const UNINIT: ::core::mem::MaybeUninit<iovec> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<iovec>(),
16usize,
concat!("Size of: ", stringify!(iovec))
);
assert_eq!(
::core::mem::align_of::<iovec>(),
8usize,
concat!("Alignment of ", stringify!(iovec))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).iov_base) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(iovec),
"::",
stringify!(iov_base)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).iov_len) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(iovec),
"::",
stringify!(iov_len)
)
);
}
impl Default for iovec {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}