diff --git a/Cargo.toml b/Cargo.toml index e7f14ea..5b3c604 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] members = [ - "libcsp-cargo-build", "libcsp-rust", "libcsp-sys", "examples" + "libcsp-cargo-build", "libcsp", "libcsp-sys", "examples" ] resolver = "2" diff --git a/clib/bindings.rs b/clib/bindings.rs index 9d8a50b..264b4d6 100644 --- a/clib/bindings.rs +++ b/clib/bindings.rs @@ -1,5 +1,35 @@ /* automatically generated by rust-bindgen 0.69.4 */ +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::core::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::core::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::core::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::core::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} pub const CSP_ERR_NONE: u32 = 0; pub const CSP_ERR_NOMEM: i32 = -1; pub const CSP_ERR_INVAL: i32 = -2; @@ -358,16 +388,11 @@ pub const _STRINGS_H: u32 = 1; pub const CSP_MAX_TIMEOUT: u32 = 4294967295; pub const CSP_MAX_DELAY: u32 = 4294967295; pub const CSP_INFINITY: u32 = 4294967295; -pub const CSP_SEMAPHORE_OK: u32 = 0; -pub const CSP_SEMAPHORE_ERROR: i32 = -1; -pub const _SEMAPHORE_H: u32 = 1; -pub const _SYS_TYPES_H: u32 = 1; -pub const __clock_t_defined: u32 = 1; -pub const __clockid_t_defined: u32 = 1; +pub const CSP_IF_LOOPBACK_NAME: &[u8; 5] = b"LOOP\0"; +pub const _PTHREAD_H: u32 = 1; +pub const _SCHED_H: u32 = 1; pub const __time_t_defined: u32 = 1; -pub const __timer_t_defined: u32 = 1; -pub const __BIT_TYPES_DEFINED__: u32 = 1; -pub const _ENDIAN_H: u32 = 1; +pub const _STRUCT_TIMESPEC: u32 = 1; pub const _BITS_ENDIAN_H: u32 = 1; pub const __LITTLE_ENDIAN: u32 = 1234; pub const __BIG_ENDIAN: u32 = 4321; @@ -375,17 +400,33 @@ pub const __PDP_ENDIAN: u32 = 3412; pub const _BITS_ENDIANNESS_H: u32 = 1; pub const __BYTE_ORDER: u32 = 1234; pub const __FLOAT_WORD_ORDER: u32 = 1234; -pub const LITTLE_ENDIAN: u32 = 1234; -pub const BIG_ENDIAN: u32 = 4321; -pub const PDP_ENDIAN: u32 = 3412; -pub const BYTE_ORDER: u32 = 1234; -pub const _BITS_BYTESWAP_H: u32 = 1; -pub const _BITS_UINTN_IDENTITY_H: u32 = 1; -pub const _SYS_SELECT_H: u32 = 1; -pub const __sigset_t_defined: u32 = 1; -pub const __timeval_defined: u32 = 1; -pub const _STRUCT_TIMESPEC: u32 = 1; -pub const FD_SETSIZE: u32 = 1024; +pub const _BITS_SCHED_H: u32 = 1; +pub const SCHED_OTHER: u32 = 0; +pub const SCHED_FIFO: u32 = 1; +pub const SCHED_RR: u32 = 2; +pub const _BITS_TYPES_STRUCT_SCHED_PARAM: u32 = 1; +pub const _BITS_CPU_SET_H: u32 = 1; +pub const __CPU_SETSIZE: u32 = 1024; +pub const _TIME_H: u32 = 1; +pub const _BITS_TIME_H: u32 = 1; +pub const CLOCK_REALTIME: u32 = 0; +pub const CLOCK_MONOTONIC: u32 = 1; +pub const CLOCK_PROCESS_CPUTIME_ID: u32 = 2; +pub const CLOCK_THREAD_CPUTIME_ID: u32 = 3; +pub const CLOCK_MONOTONIC_RAW: u32 = 4; +pub const CLOCK_REALTIME_COARSE: u32 = 5; +pub const CLOCK_MONOTONIC_COARSE: u32 = 6; +pub const CLOCK_BOOTTIME: u32 = 7; +pub const CLOCK_REALTIME_ALARM: u32 = 8; +pub const CLOCK_BOOTTIME_ALARM: u32 = 9; +pub const CLOCK_TAI: u32 = 11; +pub const TIMER_ABSTIME: u32 = 1; +pub const __clock_t_defined: u32 = 1; +pub const __struct_tm_defined: u32 = 1; +pub const __clockid_t_defined: u32 = 1; +pub const __timer_t_defined: u32 = 1; +pub const __itimerspec_defined: u32 = 1; +pub const TIME_UTC: u32 = 1; pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1; pub const _THREAD_SHARED_TYPES_H: u32 = 1; pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1; @@ -401,6 +442,394 @@ pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; pub const _THREAD_MUTEX_INTERNAL_H: u32 = 1; pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; pub const __have_pthread_attr_t: u32 = 1; +pub const _BITS_SETJMP_H: u32 = 1; +pub const __jmp_buf_tag_defined: u32 = 1; +pub const PTHREAD_STACK_MIN: u32 = 16384; +pub const PTHREAD_ONCE_INIT: u32 = 0; +pub const PTHREAD_BARRIER_SERIAL_THREAD: i32 = -1; +pub const _NETINET_IN_H: u32 = 1; +pub const _SYS_SOCKET_H: u32 = 1; +pub const __iovec_defined: u32 = 1; +pub const _SYS_TYPES_H: u32 = 1; +pub const __BIT_TYPES_DEFINED__: u32 = 1; +pub const _ENDIAN_H: u32 = 1; +pub const LITTLE_ENDIAN: u32 = 1234; +pub const BIG_ENDIAN: u32 = 4321; +pub const PDP_ENDIAN: u32 = 3412; +pub const BYTE_ORDER: u32 = 1234; +pub const _BITS_BYTESWAP_H: u32 = 1; +pub const _BITS_UINTN_IDENTITY_H: u32 = 1; +pub const _SYS_SELECT_H: u32 = 1; +pub const __sigset_t_defined: u32 = 1; +pub const __timeval_defined: u32 = 1; +pub const FD_SETSIZE: u32 = 1024; +pub const PF_UNSPEC: u32 = 0; +pub const PF_LOCAL: u32 = 1; +pub const PF_UNIX: u32 = 1; +pub const PF_FILE: u32 = 1; +pub const PF_INET: u32 = 2; +pub const PF_AX25: u32 = 3; +pub const PF_IPX: u32 = 4; +pub const PF_APPLETALK: u32 = 5; +pub const PF_NETROM: u32 = 6; +pub const PF_BRIDGE: u32 = 7; +pub const PF_ATMPVC: u32 = 8; +pub const PF_X25: u32 = 9; +pub const PF_INET6: u32 = 10; +pub const PF_ROSE: u32 = 11; +pub const PF_DECnet: u32 = 12; +pub const PF_NETBEUI: u32 = 13; +pub const PF_SECURITY: u32 = 14; +pub const PF_KEY: u32 = 15; +pub const PF_NETLINK: u32 = 16; +pub const PF_ROUTE: u32 = 16; +pub const PF_PACKET: u32 = 17; +pub const PF_ASH: u32 = 18; +pub const PF_ECONET: u32 = 19; +pub const PF_ATMSVC: u32 = 20; +pub const PF_RDS: u32 = 21; +pub const PF_SNA: u32 = 22; +pub const PF_IRDA: u32 = 23; +pub const PF_PPPOX: u32 = 24; +pub const PF_WANPIPE: u32 = 25; +pub const PF_LLC: u32 = 26; +pub const PF_IB: u32 = 27; +pub const PF_MPLS: u32 = 28; +pub const PF_CAN: u32 = 29; +pub const PF_TIPC: u32 = 30; +pub const PF_BLUETOOTH: u32 = 31; +pub const PF_IUCV: u32 = 32; +pub const PF_RXRPC: u32 = 33; +pub const PF_ISDN: u32 = 34; +pub const PF_PHONET: u32 = 35; +pub const PF_IEEE802154: u32 = 36; +pub const PF_CAIF: u32 = 37; +pub const PF_ALG: u32 = 38; +pub const PF_NFC: u32 = 39; +pub const PF_VSOCK: u32 = 40; +pub const PF_KCM: u32 = 41; +pub const PF_QIPCRTR: u32 = 42; +pub const PF_SMC: u32 = 43; +pub const PF_XDP: u32 = 44; +pub const PF_MCTP: u32 = 45; +pub const PF_MAX: u32 = 46; +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_MCTP: u32 = 45; +pub const AF_MAX: u32 = 46; +pub const SOL_RAW: u32 = 255; +pub const SOL_DECNET: u32 = 261; +pub const SOL_X25: u32 = 262; +pub const SOL_PACKET: u32 = 263; +pub const SOL_ATM: u32 = 264; +pub const SOL_AAL: u32 = 265; +pub const SOL_IRDA: u32 = 266; +pub const SOL_NETBEUI: u32 = 267; +pub const SOL_LLC: u32 = 268; +pub const SOL_DCCP: u32 = 269; +pub const SOL_NETLINK: u32 = 270; +pub const SOL_TIPC: u32 = 271; +pub const SOL_RXRPC: u32 = 272; +pub const SOL_PPPOL2TP: u32 = 273; +pub const SOL_BLUETOOTH: u32 = 274; +pub const SOL_PNPIPE: u32 = 275; +pub const SOL_RDS: u32 = 276; +pub const SOL_IUCV: u32 = 277; +pub const SOL_CAIF: u32 = 278; +pub const SOL_ALG: u32 = 279; +pub const SOL_NFC: u32 = 280; +pub const SOL_KCM: u32 = 281; +pub const SOL_TLS: u32 = 282; +pub const SOL_XDP: u32 = 283; +pub const SOMAXCONN: u32 = 4096; +pub const _BITS_SOCKADDR_H: u32 = 1; +pub const _SS_SIZE: u32 = 128; +pub const __BITS_PER_LONG: u32 = 64; +pub const FIOSETOWN: u32 = 35073; +pub const SIOCSPGRP: u32 = 35074; +pub const FIOGETOWN: u32 = 35075; +pub const SIOCGPGRP: u32 = 35076; +pub const SIOCATMARK: u32 = 35077; +pub const SIOCGSTAMP_OLD: u32 = 35078; +pub const SIOCGSTAMPNS_OLD: u32 = 35079; +pub const SOL_SOCKET: u32 = 1; +pub const SO_DEBUG: u32 = 1; +pub const SO_REUSEADDR: u32 = 2; +pub const SO_TYPE: u32 = 3; +pub const SO_ERROR: u32 = 4; +pub const SO_DONTROUTE: u32 = 5; +pub const SO_BROADCAST: u32 = 6; +pub const SO_SNDBUF: u32 = 7; +pub const SO_RCVBUF: u32 = 8; +pub const SO_SNDBUFFORCE: u32 = 32; +pub const SO_RCVBUFFORCE: u32 = 33; +pub const SO_KEEPALIVE: u32 = 9; +pub const SO_OOBINLINE: u32 = 10; +pub const SO_NO_CHECK: u32 = 11; +pub const SO_PRIORITY: u32 = 12; +pub const SO_LINGER: u32 = 13; +pub const SO_BSDCOMPAT: u32 = 14; +pub const SO_REUSEPORT: u32 = 15; +pub const SO_PASSCRED: u32 = 16; +pub const SO_PEERCRED: u32 = 17; +pub const SO_RCVLOWAT: u32 = 18; +pub const SO_SNDLOWAT: u32 = 19; +pub const SO_RCVTIMEO_OLD: u32 = 20; +pub const SO_SNDTIMEO_OLD: u32 = 21; +pub const SO_SECURITY_AUTHENTICATION: u32 = 22; +pub const SO_SECURITY_ENCRYPTION_TRANSPORT: u32 = 23; +pub const SO_SECURITY_ENCRYPTION_NETWORK: u32 = 24; +pub const SO_BINDTODEVICE: u32 = 25; +pub const SO_ATTACH_FILTER: u32 = 26; +pub const SO_DETACH_FILTER: u32 = 27; +pub const SO_GET_FILTER: u32 = 26; +pub const SO_PEERNAME: u32 = 28; +pub const SO_ACCEPTCONN: u32 = 30; +pub const SO_PEERSEC: u32 = 31; +pub const SO_PASSSEC: u32 = 34; +pub const SO_MARK: u32 = 36; +pub const SO_PROTOCOL: u32 = 38; +pub const SO_DOMAIN: u32 = 39; +pub const SO_RXQ_OVFL: u32 = 40; +pub const SO_WIFI_STATUS: u32 = 41; +pub const SCM_WIFI_STATUS: u32 = 41; +pub const SO_PEEK_OFF: u32 = 42; +pub const SO_NOFCS: u32 = 43; +pub const SO_LOCK_FILTER: u32 = 44; +pub const SO_SELECT_ERR_QUEUE: u32 = 45; +pub const SO_BUSY_POLL: u32 = 46; +pub const SO_MAX_PACING_RATE: u32 = 47; +pub const SO_BPF_EXTENSIONS: u32 = 48; +pub const SO_INCOMING_CPU: u32 = 49; +pub const SO_ATTACH_BPF: u32 = 50; +pub const SO_DETACH_BPF: u32 = 27; +pub const SO_ATTACH_REUSEPORT_CBPF: u32 = 51; +pub const SO_ATTACH_REUSEPORT_EBPF: u32 = 52; +pub const SO_CNX_ADVICE: u32 = 53; +pub const SCM_TIMESTAMPING_OPT_STATS: u32 = 54; +pub const SO_MEMINFO: u32 = 55; +pub const SO_INCOMING_NAPI_ID: u32 = 56; +pub const SO_COOKIE: u32 = 57; +pub const SCM_TIMESTAMPING_PKTINFO: u32 = 58; +pub const SO_PEERGROUPS: u32 = 59; +pub const SO_ZEROCOPY: u32 = 60; +pub const SO_TXTIME: u32 = 61; +pub const SCM_TXTIME: u32 = 61; +pub const SO_BINDTOIFINDEX: u32 = 62; +pub const SO_TIMESTAMP_OLD: u32 = 29; +pub const SO_TIMESTAMPNS_OLD: u32 = 35; +pub const SO_TIMESTAMPING_OLD: u32 = 37; +pub const SO_TIMESTAMP_NEW: u32 = 63; +pub const SO_TIMESTAMPNS_NEW: u32 = 64; +pub const SO_TIMESTAMPING_NEW: u32 = 65; +pub const SO_RCVTIMEO_NEW: u32 = 66; +pub const SO_SNDTIMEO_NEW: u32 = 67; +pub const SO_DETACH_REUSEPORT_BPF: u32 = 68; +pub const SO_PREFER_BUSY_POLL: u32 = 69; +pub const SO_BUSY_POLL_BUDGET: u32 = 70; +pub const SO_NETNS_COOKIE: u32 = 71; +pub const SO_BUF_LOCK: u32 = 72; +pub const SO_TIMESTAMP: u32 = 29; +pub const SO_TIMESTAMPNS: u32 = 35; +pub const SO_TIMESTAMPING: u32 = 37; +pub const SO_RCVTIMEO: u32 = 20; +pub const SO_SNDTIMEO: u32 = 21; +pub const SCM_TIMESTAMP: u32 = 29; +pub const SCM_TIMESTAMPNS: u32 = 35; +pub const SCM_TIMESTAMPING: u32 = 37; +pub const __osockaddr_defined: u32 = 1; +pub const __USE_KERNEL_IPV6_DEFS: u32 = 0; +pub const IP_OPTIONS: u32 = 4; +pub const IP_HDRINCL: u32 = 3; +pub const IP_TOS: u32 = 1; +pub const IP_TTL: u32 = 2; +pub const IP_RECVOPTS: u32 = 6; +pub const IP_RETOPTS: u32 = 7; +pub const IP_MULTICAST_IF: u32 = 32; +pub const IP_MULTICAST_TTL: u32 = 33; +pub const IP_MULTICAST_LOOP: u32 = 34; +pub const IP_ADD_MEMBERSHIP: u32 = 35; +pub const IP_DROP_MEMBERSHIP: u32 = 36; +pub const IP_UNBLOCK_SOURCE: u32 = 37; +pub const IP_BLOCK_SOURCE: u32 = 38; +pub const IP_ADD_SOURCE_MEMBERSHIP: u32 = 39; +pub const IP_DROP_SOURCE_MEMBERSHIP: u32 = 40; +pub const IP_MSFILTER: u32 = 41; +pub const MCAST_JOIN_GROUP: u32 = 42; +pub const MCAST_BLOCK_SOURCE: u32 = 43; +pub const MCAST_UNBLOCK_SOURCE: u32 = 44; +pub const MCAST_LEAVE_GROUP: u32 = 45; +pub const MCAST_JOIN_SOURCE_GROUP: u32 = 46; +pub const MCAST_LEAVE_SOURCE_GROUP: u32 = 47; +pub const MCAST_MSFILTER: u32 = 48; +pub const IP_MULTICAST_ALL: u32 = 49; +pub const IP_UNICAST_IF: u32 = 50; +pub const MCAST_EXCLUDE: u32 = 0; +pub const MCAST_INCLUDE: u32 = 1; +pub const IP_ROUTER_ALERT: u32 = 5; +pub const IP_PKTINFO: u32 = 8; +pub const IP_PKTOPTIONS: u32 = 9; +pub const IP_PMTUDISC: u32 = 10; +pub const IP_MTU_DISCOVER: u32 = 10; +pub const IP_RECVERR: u32 = 11; +pub const IP_RECVTTL: u32 = 12; +pub const IP_RECVTOS: u32 = 13; +pub const IP_MTU: u32 = 14; +pub const IP_FREEBIND: u32 = 15; +pub const IP_IPSEC_POLICY: u32 = 16; +pub const IP_XFRM_POLICY: u32 = 17; +pub const IP_PASSSEC: u32 = 18; +pub const IP_TRANSPARENT: u32 = 19; +pub const IP_ORIGDSTADDR: u32 = 20; +pub const IP_RECVORIGDSTADDR: u32 = 20; +pub const IP_MINTTL: u32 = 21; +pub const IP_NODEFRAG: u32 = 22; +pub const IP_CHECKSUM: u32 = 23; +pub const IP_BIND_ADDRESS_NO_PORT: u32 = 24; +pub const IP_RECVFRAGSIZE: u32 = 25; +pub const IP_RECVERR_RFC4884: u32 = 26; +pub const IP_PMTUDISC_DONT: u32 = 0; +pub const IP_PMTUDISC_WANT: u32 = 1; +pub const IP_PMTUDISC_DO: u32 = 2; +pub const IP_PMTUDISC_PROBE: u32 = 3; +pub const IP_PMTUDISC_INTERFACE: u32 = 4; +pub const IP_PMTUDISC_OMIT: u32 = 5; +pub const SOL_IP: u32 = 0; +pub const IP_DEFAULT_MULTICAST_TTL: u32 = 1; +pub const IP_DEFAULT_MULTICAST_LOOP: u32 = 1; +pub const IP_MAX_MEMBERSHIPS: u32 = 20; +pub const IPV6_ADDRFORM: u32 = 1; +pub const IPV6_2292PKTINFO: u32 = 2; +pub const IPV6_2292HOPOPTS: u32 = 3; +pub const IPV6_2292DSTOPTS: u32 = 4; +pub const IPV6_2292RTHDR: u32 = 5; +pub const IPV6_2292PKTOPTIONS: u32 = 6; +pub const IPV6_CHECKSUM: u32 = 7; +pub const IPV6_2292HOPLIMIT: u32 = 8; +pub const IPV6_NEXTHOP: u32 = 9; +pub const IPV6_AUTHHDR: u32 = 10; +pub const IPV6_UNICAST_HOPS: u32 = 16; +pub const IPV6_MULTICAST_IF: u32 = 17; +pub const IPV6_MULTICAST_HOPS: u32 = 18; +pub const IPV6_MULTICAST_LOOP: u32 = 19; +pub const IPV6_JOIN_GROUP: u32 = 20; +pub const IPV6_LEAVE_GROUP: u32 = 21; +pub const IPV6_ROUTER_ALERT: u32 = 22; +pub const IPV6_MTU_DISCOVER: u32 = 23; +pub const IPV6_MTU: u32 = 24; +pub const IPV6_RECVERR: u32 = 25; +pub const IPV6_V6ONLY: u32 = 26; +pub const IPV6_JOIN_ANYCAST: u32 = 27; +pub const IPV6_LEAVE_ANYCAST: u32 = 28; +pub const IPV6_MULTICAST_ALL: u32 = 29; +pub const IPV6_ROUTER_ALERT_ISOLATE: u32 = 30; +pub const IPV6_RECVERR_RFC4884: u32 = 31; +pub const IPV6_IPSEC_POLICY: u32 = 34; +pub const IPV6_XFRM_POLICY: u32 = 35; +pub const IPV6_HDRINCL: u32 = 36; +pub const IPV6_RECVPKTINFO: u32 = 49; +pub const IPV6_PKTINFO: u32 = 50; +pub const IPV6_RECVHOPLIMIT: u32 = 51; +pub const IPV6_HOPLIMIT: u32 = 52; +pub const IPV6_RECVHOPOPTS: u32 = 53; +pub const IPV6_HOPOPTS: u32 = 54; +pub const IPV6_RTHDRDSTOPTS: u32 = 55; +pub const IPV6_RECVRTHDR: u32 = 56; +pub const IPV6_RTHDR: u32 = 57; +pub const IPV6_RECVDSTOPTS: u32 = 58; +pub const IPV6_DSTOPTS: u32 = 59; +pub const IPV6_RECVPATHMTU: u32 = 60; +pub const IPV6_PATHMTU: u32 = 61; +pub const IPV6_DONTFRAG: u32 = 62; +pub const IPV6_RECVTCLASS: u32 = 66; +pub const IPV6_TCLASS: u32 = 67; +pub const IPV6_AUTOFLOWLABEL: u32 = 70; +pub const IPV6_ADDR_PREFERENCES: u32 = 72; +pub const IPV6_MINHOPCOUNT: u32 = 73; +pub const IPV6_ORIGDSTADDR: u32 = 74; +pub const IPV6_RECVORIGDSTADDR: u32 = 74; +pub const IPV6_TRANSPARENT: u32 = 75; +pub const IPV6_UNICAST_IF: u32 = 76; +pub const IPV6_RECVFRAGSIZE: u32 = 77; +pub const IPV6_FREEBIND: u32 = 78; +pub const IPV6_ADD_MEMBERSHIP: u32 = 20; +pub const IPV6_DROP_MEMBERSHIP: u32 = 21; +pub const IPV6_RXHOPOPTS: u32 = 54; +pub const IPV6_RXDSTOPTS: u32 = 59; +pub const IPV6_PMTUDISC_DONT: u32 = 0; +pub const IPV6_PMTUDISC_WANT: u32 = 1; +pub const IPV6_PMTUDISC_DO: u32 = 2; +pub const IPV6_PMTUDISC_PROBE: u32 = 3; +pub const IPV6_PMTUDISC_INTERFACE: u32 = 4; +pub const IPV6_PMTUDISC_OMIT: u32 = 5; +pub const SOL_IPV6: u32 = 41; +pub const SOL_ICMPV6: u32 = 58; +pub const IPV6_RTHDR_LOOSE: u32 = 0; +pub const IPV6_RTHDR_STRICT: u32 = 1; +pub const IPV6_RTHDR_TYPE_0: u32 = 0; +pub const IN_CLASSA_NET: u32 = 4278190080; +pub const IN_CLASSA_NSHIFT: u32 = 24; +pub const IN_CLASSA_HOST: u32 = 16777215; +pub const IN_CLASSA_MAX: u32 = 128; +pub const IN_CLASSB_NET: u32 = 4294901760; +pub const IN_CLASSB_NSHIFT: u32 = 16; +pub const IN_CLASSB_HOST: u32 = 65535; +pub const IN_CLASSB_MAX: u32 = 65536; +pub const IN_CLASSC_NET: u32 = 4294967040; +pub const IN_CLASSC_NSHIFT: u32 = 8; +pub const IN_CLASSC_HOST: u32 = 255; +pub const IN_LOOPBACKNET: u32 = 127; +pub const INET_ADDRSTRLEN: u32 = 16; +pub const INET6_ADDRSTRLEN: u32 = 46; +pub const CSP_SEMAPHORE_OK: u32 = 0; +pub const CSP_SEMAPHORE_ERROR: i32 = -1; +pub const _SEMAPHORE_H: u32 = 1; pub const __SIZEOF_SEM_T: u32 = 32; pub const CSP_RDP_CLOSED_BY_USERSPACE: u32 = 1; pub const CSP_RDP_CLOSED_BY_PROTOCOL: u32 = 2; @@ -2450,202 +2879,11 @@ extern "C" { str_size: ::core::ffi::c_int, ) -> ::core::ffi::c_int; } -pub const memory_order_memory_order_relaxed: memory_order = 0; -pub const memory_order_memory_order_consume: memory_order = 1; -pub const memory_order_memory_order_acquire: memory_order = 2; -pub const memory_order_memory_order_release: memory_order = 3; -pub const memory_order_memory_order_acq_rel: memory_order = 4; -pub const memory_order_memory_order_seq_cst: memory_order = 5; -pub type memory_order = ::core::ffi::c_uint; extern "C" { - pub fn atomic_thread_fence(arg1: memory_order); + #[doc = " Loopback interface."] + pub static mut csp_if_lo: csp_iface_t; } -extern "C" { - pub fn atomic_signal_fence(arg1: memory_order); -} -pub type atomic_bool = u8; -pub type atomic_char = u8; -pub type atomic_schar = u8; -pub type atomic_uchar = u8; -pub type atomic_short = u16; -pub type atomic_ushort = u16; -pub type atomic_int = u32; -pub type atomic_uint = u32; -pub type atomic_long = u64; -pub type atomic_ulong = u64; -pub type atomic_llong = u64; -pub type atomic_ullong = u64; -pub type atomic_char16_t = u16; -pub type atomic_char32_t = u32; -pub type atomic_wchar_t = u32; -pub type atomic_int_least8_t = u8; -pub type atomic_uint_least8_t = u8; -pub type atomic_int_least16_t = u16; -pub type atomic_uint_least16_t = u16; -pub type atomic_int_least32_t = u32; -pub type atomic_uint_least32_t = u32; -pub type atomic_int_least64_t = u64; -pub type atomic_uint_least64_t = u64; -pub type atomic_int_fast8_t = u8; -pub type atomic_uint_fast8_t = u8; -pub type atomic_int_fast16_t = u64; -pub type atomic_uint_fast16_t = u64; -pub type atomic_int_fast32_t = u64; -pub type atomic_uint_fast32_t = u64; -pub type atomic_int_fast64_t = u64; -pub type atomic_uint_fast64_t = u64; -pub type atomic_intptr_t = u64; -pub type atomic_uintptr_t = u64; -pub type atomic_size_t = u64; -pub type atomic_ptrdiff_t = u64; -pub type atomic_intmax_t = u64; -pub type atomic_uintmax_t = u64; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct atomic_flag { - pub _Value: atomic_bool, -} -#[test] -fn bindgen_test_layout_atomic_flag() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(atomic_flag)) - ); - assert_eq!( - ::core::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(atomic_flag)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr)._Value) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(atomic_flag), - "::", - stringify!(_Value) - ) - ); -} -extern "C" { - pub fn atomic_flag_test_and_set(arg1: *mut atomic_flag) -> bool; -} -extern "C" { - pub fn atomic_flag_test_and_set_explicit(arg1: *mut atomic_flag, arg2: memory_order) -> bool; -} -extern "C" { - pub fn atomic_flag_clear(arg1: *mut atomic_flag); -} -extern "C" { - pub fn atomic_flag_clear_explicit(arg1: *mut atomic_flag, arg2: memory_order); -} -pub type u_char = __u_char; -pub type u_short = __u_short; -pub type u_int = __u_int; -pub type u_long = __u_long; -pub type quad_t = __quad_t; -pub type u_quad_t = __u_quad_t; -pub type fsid_t = __fsid_t; -pub type loff_t = __loff_t; -pub type ino_t = __ino_t; -pub type dev_t = __dev_t; -pub type gid_t = __gid_t; -pub type mode_t = __mode_t; -pub type nlink_t = __nlink_t; -pub type uid_t = __uid_t; -pub type off_t = __off_t; -pub type pid_t = __pid_t; -pub type id_t = __id_t; -pub type daddr_t = __daddr_t; -pub type caddr_t = __caddr_t; -pub type key_t = __key_t; -pub type clock_t = __clock_t; -pub type clockid_t = __clockid_t; pub type time_t = __time_t; -pub type timer_t = __timer_t; -pub type ulong = ::core::ffi::c_ulong; -pub type ushort = ::core::ffi::c_ushort; -pub type uint = ::core::ffi::c_uint; -pub type u_int8_t = __uint8_t; -pub type u_int16_t = __uint16_t; -pub type u_int32_t = __uint32_t; -pub type u_int64_t = __uint64_t; -pub type register_t = ::core::ffi::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sigset_t { - pub __val: [::core::ffi::c_ulong; 16usize], -} -#[test] -fn bindgen_test_layout___sigset_t() { - const UNINIT: ::core::mem::MaybeUninit<__sigset_t> = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::<__sigset_t>(), - 128usize, - concat!("Size of: ", stringify!(__sigset_t)) - ); - assert_eq!( - ::core::mem::align_of::<__sigset_t>(), - 8usize, - concat!("Alignment of ", stringify!(__sigset_t)) - ); - assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sigset_t), - "::", - stringify!(__val) - ) - ); -} -pub type sigset_t = __sigset_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timeval { - pub tv_sec: __time_t, - pub tv_usec: __suseconds_t, -} -#[test] -fn bindgen_test_layout_timeval() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(timeval)) - ); - assert_eq!( - ::core::mem::align_of::(), - 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, Copy, Clone)] pub struct timespec { @@ -2687,62 +2925,433 @@ fn bindgen_test_layout_timespec() { ) ); } -pub type suseconds_t = __suseconds_t; -pub type __fd_mask = ::core::ffi::c_long; +pub type pid_t = __pid_t; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct fd_set { - pub __fds_bits: [__fd_mask; 16usize], +pub struct sched_param { + pub sched_priority: ::core::ffi::c_int, } #[test] -fn bindgen_test_layout_fd_set() { - const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_sched_param() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::core::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(fd_set)) + ::core::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(sched_param)) ); assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(fd_set)) + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(sched_param)) ); assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).__fds_bits) as usize - ptr as usize }, + unsafe { ::core::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(fd_set), + stringify!(sched_param), "::", - stringify!(__fds_bits) + stringify!(sched_priority) + ) + ); +} +pub type __cpu_mask = ::core::ffi::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct cpu_set_t { + pub __bits: [__cpu_mask; 16usize], +} +#[test] +fn bindgen_test_layout_cpu_set_t() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 128usize, + concat!("Size of: ", stringify!(cpu_set_t)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(cpu_set_t)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__bits) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cpu_set_t), + "::", + stringify!(__bits) ) ); } -pub type fd_mask = __fd_mask; extern "C" { - pub fn select( - __nfds: ::core::ffi::c_int, - __readfds: *mut fd_set, - __writefds: *mut fd_set, - __exceptfds: *mut fd_set, - __timeout: *mut timeval, + pub fn __sched_cpucount(__setsize: usize, __setp: *const cpu_set_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn __sched_cpualloc(__count: usize) -> *mut cpu_set_t; +} +extern "C" { + pub fn __sched_cpufree(__set: *mut cpu_set_t); +} +extern "C" { + pub fn sched_setparam(__pid: __pid_t, __param: *const sched_param) -> ::core::ffi::c_int; +} +extern "C" { + pub fn sched_getparam(__pid: __pid_t, __param: *mut sched_param) -> ::core::ffi::c_int; +} +extern "C" { + pub fn sched_setscheduler( + __pid: __pid_t, + __policy: ::core::ffi::c_int, + __param: *const sched_param, ) -> ::core::ffi::c_int; } extern "C" { - pub fn pselect( - __nfds: ::core::ffi::c_int, - __readfds: *mut fd_set, - __writefds: *mut fd_set, - __exceptfds: *mut fd_set, - __timeout: *const timespec, - __sigmask: *const __sigset_t, + pub fn sched_getscheduler(__pid: __pid_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn sched_yield() -> ::core::ffi::c_int; +} +extern "C" { + pub fn sched_get_priority_max(__algorithm: ::core::ffi::c_int) -> ::core::ffi::c_int; +} +extern "C" { + pub fn sched_get_priority_min(__algorithm: ::core::ffi::c_int) -> ::core::ffi::c_int; +} +extern "C" { + pub fn sched_rr_get_interval(__pid: __pid_t, __t: *mut timespec) -> ::core::ffi::c_int; +} +pub type clock_t = __clock_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tm { + pub tm_sec: ::core::ffi::c_int, + pub tm_min: ::core::ffi::c_int, + pub tm_hour: ::core::ffi::c_int, + pub tm_mday: ::core::ffi::c_int, + pub tm_mon: ::core::ffi::c_int, + pub tm_year: ::core::ffi::c_int, + pub tm_wday: ::core::ffi::c_int, + pub tm_yday: ::core::ffi::c_int, + pub tm_isdst: ::core::ffi::c_int, + pub tm_gmtoff: ::core::ffi::c_long, + pub tm_zone: *const ::core::ffi::c_char, +} +#[test] +fn bindgen_test_layout_tm() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(tm)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tm)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_sec) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_min) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_hour) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mday) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_mon) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_year) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_wday) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_yday) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_isdst) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_gmtoff) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(tm), + "::", + stringify!(tm_zone) + ) + ); +} +pub type clockid_t = __clockid_t; +pub type timer_t = __timer_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct itimerspec { + pub it_interval: timespec, + pub it_value: timespec, +} +#[test] +fn bindgen_test_layout_itimerspec() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(itimerspec)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(itimerspec)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(itimerspec), + "::", + stringify!(it_interval) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(itimerspec), + "::", + stringify!(it_value) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sigevent { + _unused: [u8; 0], +} +extern "C" { + pub fn clock() -> clock_t; +} +extern "C" { + pub fn time(__timer: *mut time_t) -> time_t; +} +extern "C" { + pub fn difftime(__time1: time_t, __time0: time_t) -> f64; +} +extern "C" { + pub fn mktime(__tp: *mut tm) -> time_t; +} +extern "C" { + pub fn strftime( + __s: *mut ::core::ffi::c_char, + __maxsize: usize, + __format: *const ::core::ffi::c_char, + __tp: *const tm, + ) -> usize; +} +extern "C" { + pub fn strftime_l( + __s: *mut ::core::ffi::c_char, + __maxsize: usize, + __format: *const ::core::ffi::c_char, + __tp: *const tm, + __loc: locale_t, + ) -> usize; +} +extern "C" { + pub fn gmtime(__timer: *const time_t) -> *mut tm; +} +extern "C" { + pub fn localtime(__timer: *const time_t) -> *mut tm; +} +extern "C" { + pub fn gmtime_r(__timer: *const time_t, __tp: *mut tm) -> *mut tm; +} +extern "C" { + pub fn localtime_r(__timer: *const time_t, __tp: *mut tm) -> *mut tm; +} +extern "C" { + pub fn asctime(__tp: *const tm) -> *mut ::core::ffi::c_char; +} +extern "C" { + pub fn ctime(__timer: *const time_t) -> *mut ::core::ffi::c_char; +} +extern "C" { + pub fn asctime_r(__tp: *const tm, __buf: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char; +} +extern "C" { + pub fn ctime_r( + __timer: *const time_t, + __buf: *mut ::core::ffi::c_char, + ) -> *mut ::core::ffi::c_char; +} +extern "C" { + pub static mut __tzname: [*mut ::core::ffi::c_char; 2usize]; +} +extern "C" { + pub static mut __daylight: ::core::ffi::c_int; +} +extern "C" { + pub static mut __timezone: ::core::ffi::c_long; +} +extern "C" { + pub static mut tzname: [*mut ::core::ffi::c_char; 2usize]; +} +extern "C" { + pub fn tzset(); +} +extern "C" { + pub static mut daylight: ::core::ffi::c_int; +} +extern "C" { + pub static mut timezone: ::core::ffi::c_long; +} +extern "C" { + pub fn timegm(__tp: *mut tm) -> time_t; +} +extern "C" { + pub fn timelocal(__tp: *mut tm) -> time_t; +} +extern "C" { + pub fn dysize(__year: ::core::ffi::c_int) -> ::core::ffi::c_int; +} +extern "C" { + pub fn nanosleep( + __requested_time: *const timespec, + __remaining: *mut timespec, ) -> ::core::ffi::c_int; } -pub type blksize_t = __blksize_t; -pub type blkcnt_t = __blkcnt_t; -pub type fsblkcnt_t = __fsblkcnt_t; -pub type fsfilcnt_t = __fsfilcnt_t; +extern "C" { + pub fn clock_getres(__clock_id: clockid_t, __res: *mut timespec) -> ::core::ffi::c_int; +} +extern "C" { + pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut timespec) -> ::core::ffi::c_int; +} +extern "C" { + pub fn clock_settime(__clock_id: clockid_t, __tp: *const timespec) -> ::core::ffi::c_int; +} +extern "C" { + pub fn clock_nanosleep( + __clock_id: clockid_t, + __flags: ::core::ffi::c_int, + __req: *const timespec, + __rem: *mut timespec, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn clock_getcpuclockid(__pid: pid_t, __clock_id: *mut clockid_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn timer_create( + __clock_id: clockid_t, + __evp: *mut sigevent, + __timerid: *mut timer_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn timer_delete(__timerid: timer_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn timer_settime( + __timerid: timer_t, + __flags: ::core::ffi::c_int, + __value: *const itimerspec, + __ovalue: *mut itimerspec, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn timer_gettime(__timerid: timer_t, __value: *mut itimerspec) -> ::core::ffi::c_int; +} +extern "C" { + pub fn timer_getoverrun(__timerid: timer_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn timespec_get(__ts: *mut timespec, __base: ::core::ffi::c_int) -> ::core::ffi::c_int; +} #[repr(C)] #[derive(Copy, Clone)] pub union __atomic_wide_counter { @@ -3701,6 +4310,2671 @@ fn bindgen_test_layout_pthread_barrierattr_t() { ) ); } +pub type __jmp_buf = [::core::ffi::c_long; 8usize]; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sigset_t { + pub __val: [::core::ffi::c_ulong; 16usize], +} +#[test] +fn bindgen_test_layout___sigset_t() { + const UNINIT: ::core::mem::MaybeUninit<__sigset_t> = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<__sigset_t>(), + 128usize, + concat!("Size of: ", stringify!(__sigset_t)) + ); + assert_eq!( + ::core::mem::align_of::<__sigset_t>(), + 8usize, + concat!("Alignment of ", stringify!(__sigset_t)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__sigset_t), + "::", + stringify!(__val) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __jmp_buf_tag { + pub __jmpbuf: __jmp_buf, + pub __mask_was_saved: ::core::ffi::c_int, + pub __saved_mask: __sigset_t, +} +#[test] +fn bindgen_test_layout___jmp_buf_tag() { + const UNINIT: ::core::mem::MaybeUninit<__jmp_buf_tag> = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<__jmp_buf_tag>(), + 200usize, + concat!("Size of: ", stringify!(__jmp_buf_tag)) + ); + assert_eq!( + ::core::mem::align_of::<__jmp_buf_tag>(), + 8usize, + concat!("Alignment of ", stringify!(__jmp_buf_tag)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__jmpbuf) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__jmp_buf_tag), + "::", + stringify!(__jmpbuf) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__mask_was_saved) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(__jmp_buf_tag), + "::", + stringify!(__mask_was_saved) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__saved_mask) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(__jmp_buf_tag), + "::", + stringify!(__saved_mask) + ) + ); +} +pub const PTHREAD_CREATE_JOINABLE: _bindgen_ty_1 = 0; +pub const PTHREAD_CREATE_DETACHED: _bindgen_ty_1 = 1; +pub type _bindgen_ty_1 = ::core::ffi::c_uint; +pub const PTHREAD_MUTEX_TIMED_NP: _bindgen_ty_2 = 0; +pub const PTHREAD_MUTEX_RECURSIVE_NP: _bindgen_ty_2 = 1; +pub const PTHREAD_MUTEX_ERRORCHECK_NP: _bindgen_ty_2 = 2; +pub const PTHREAD_MUTEX_ADAPTIVE_NP: _bindgen_ty_2 = 3; +pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_2 = 0; +pub const PTHREAD_MUTEX_RECURSIVE: _bindgen_ty_2 = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: _bindgen_ty_2 = 2; +pub const PTHREAD_MUTEX_DEFAULT: _bindgen_ty_2 = 0; +pub type _bindgen_ty_2 = ::core::ffi::c_uint; +pub const PTHREAD_MUTEX_STALLED: _bindgen_ty_3 = 0; +pub const PTHREAD_MUTEX_STALLED_NP: _bindgen_ty_3 = 0; +pub const PTHREAD_MUTEX_ROBUST: _bindgen_ty_3 = 1; +pub const PTHREAD_MUTEX_ROBUST_NP: _bindgen_ty_3 = 1; +pub type _bindgen_ty_3 = ::core::ffi::c_uint; +pub const PTHREAD_PRIO_NONE: _bindgen_ty_4 = 0; +pub const PTHREAD_PRIO_INHERIT: _bindgen_ty_4 = 1; +pub const PTHREAD_PRIO_PROTECT: _bindgen_ty_4 = 2; +pub type _bindgen_ty_4 = ::core::ffi::c_uint; +pub const PTHREAD_RWLOCK_PREFER_READER_NP: _bindgen_ty_5 = 0; +pub const PTHREAD_RWLOCK_PREFER_WRITER_NP: _bindgen_ty_5 = 1; +pub const PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP: _bindgen_ty_5 = 2; +pub const PTHREAD_RWLOCK_DEFAULT_NP: _bindgen_ty_5 = 0; +pub type _bindgen_ty_5 = ::core::ffi::c_uint; +pub const PTHREAD_INHERIT_SCHED: _bindgen_ty_6 = 0; +pub const PTHREAD_EXPLICIT_SCHED: _bindgen_ty_6 = 1; +pub type _bindgen_ty_6 = ::core::ffi::c_uint; +pub const PTHREAD_SCOPE_SYSTEM: _bindgen_ty_7 = 0; +pub const PTHREAD_SCOPE_PROCESS: _bindgen_ty_7 = 1; +pub type _bindgen_ty_7 = ::core::ffi::c_uint; +pub const PTHREAD_PROCESS_PRIVATE: _bindgen_ty_8 = 0; +pub const PTHREAD_PROCESS_SHARED: _bindgen_ty_8 = 1; +pub type _bindgen_ty_8 = ::core::ffi::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _pthread_cleanup_buffer { + pub __routine: ::core::option::Option, + pub __arg: *mut ::core::ffi::c_void, + pub __canceltype: ::core::ffi::c_int, + pub __prev: *mut _pthread_cleanup_buffer, +} +#[test] +fn bindgen_test_layout__pthread_cleanup_buffer() { + const UNINIT: ::core::mem::MaybeUninit<_pthread_cleanup_buffer> = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<_pthread_cleanup_buffer>(), + 32usize, + concat!("Size of: ", stringify!(_pthread_cleanup_buffer)) + ); + assert_eq!( + ::core::mem::align_of::<_pthread_cleanup_buffer>(), + 8usize, + concat!("Alignment of ", stringify!(_pthread_cleanup_buffer)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__routine) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_pthread_cleanup_buffer), + "::", + stringify!(__routine) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__arg) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_pthread_cleanup_buffer), + "::", + stringify!(__arg) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__canceltype) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_pthread_cleanup_buffer), + "::", + stringify!(__canceltype) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_pthread_cleanup_buffer), + "::", + stringify!(__prev) + ) + ); +} +pub const PTHREAD_CANCEL_ENABLE: _bindgen_ty_9 = 0; +pub const PTHREAD_CANCEL_DISABLE: _bindgen_ty_9 = 1; +pub type _bindgen_ty_9 = ::core::ffi::c_uint; +pub const PTHREAD_CANCEL_DEFERRED: _bindgen_ty_10 = 0; +pub const PTHREAD_CANCEL_ASYNCHRONOUS: _bindgen_ty_10 = 1; +pub type _bindgen_ty_10 = ::core::ffi::c_uint; +extern "C" { + pub fn pthread_create( + __newthread: *mut pthread_t, + __attr: *const pthread_attr_t, + __start_routine: ::core::option::Option< + unsafe extern "C" fn(arg1: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void, + >, + __arg: *mut ::core::ffi::c_void, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_exit(__retval: *mut ::core::ffi::c_void) -> !; +} +extern "C" { + pub fn pthread_join( + __th: pthread_t, + __thread_return: *mut *mut ::core::ffi::c_void, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_detach(__th: pthread_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_self() -> pthread_t; +} +extern "C" { + pub fn pthread_equal(__thread1: pthread_t, __thread2: pthread_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_init(__attr: *mut pthread_attr_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_destroy(__attr: *mut pthread_attr_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_getdetachstate( + __attr: *const pthread_attr_t, + __detachstate: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_setdetachstate( + __attr: *mut pthread_attr_t, + __detachstate: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_getguardsize( + __attr: *const pthread_attr_t, + __guardsize: *mut usize, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_setguardsize( + __attr: *mut pthread_attr_t, + __guardsize: usize, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_getschedparam( + __attr: *const pthread_attr_t, + __param: *mut sched_param, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_setschedparam( + __attr: *mut pthread_attr_t, + __param: *const sched_param, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_getschedpolicy( + __attr: *const pthread_attr_t, + __policy: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_setschedpolicy( + __attr: *mut pthread_attr_t, + __policy: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_getinheritsched( + __attr: *const pthread_attr_t, + __inherit: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_setinheritsched( + __attr: *mut pthread_attr_t, + __inherit: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_getscope( + __attr: *const pthread_attr_t, + __scope: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_setscope( + __attr: *mut pthread_attr_t, + __scope: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_getstackaddr( + __attr: *const pthread_attr_t, + __stackaddr: *mut *mut ::core::ffi::c_void, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_setstackaddr( + __attr: *mut pthread_attr_t, + __stackaddr: *mut ::core::ffi::c_void, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_getstacksize( + __attr: *const pthread_attr_t, + __stacksize: *mut usize, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_setstacksize( + __attr: *mut pthread_attr_t, + __stacksize: usize, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_getstack( + __attr: *const pthread_attr_t, + __stackaddr: *mut *mut ::core::ffi::c_void, + __stacksize: *mut usize, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_attr_setstack( + __attr: *mut pthread_attr_t, + __stackaddr: *mut ::core::ffi::c_void, + __stacksize: usize, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_setschedparam( + __target_thread: pthread_t, + __policy: ::core::ffi::c_int, + __param: *const sched_param, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_getschedparam( + __target_thread: pthread_t, + __policy: *mut ::core::ffi::c_int, + __param: *mut sched_param, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_setschedprio( + __target_thread: pthread_t, + __prio: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_once( + __once_control: *mut pthread_once_t, + __init_routine: ::core::option::Option, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_setcancelstate( + __state: ::core::ffi::c_int, + __oldstate: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_setcanceltype( + __type: ::core::ffi::c_int, + __oldtype: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_cancel(__th: pthread_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_testcancel(); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __cancel_jmp_buf_tag { + pub __cancel_jmp_buf: __jmp_buf, + pub __mask_was_saved: ::core::ffi::c_int, +} +#[test] +fn bindgen_test_layout___cancel_jmp_buf_tag() { + const UNINIT: ::core::mem::MaybeUninit<__cancel_jmp_buf_tag> = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<__cancel_jmp_buf_tag>(), + 72usize, + concat!("Size of: ", stringify!(__cancel_jmp_buf_tag)) + ); + assert_eq!( + ::core::mem::align_of::<__cancel_jmp_buf_tag>(), + 8usize, + concat!("Alignment of ", stringify!(__cancel_jmp_buf_tag)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__cancel_jmp_buf) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__cancel_jmp_buf_tag), + "::", + stringify!(__cancel_jmp_buf) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__mask_was_saved) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(__cancel_jmp_buf_tag), + "::", + stringify!(__mask_was_saved) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_unwind_buf_t { + pub __cancel_jmp_buf: [__cancel_jmp_buf_tag; 1usize], + pub __pad: [*mut ::core::ffi::c_void; 4usize], +} +#[test] +fn bindgen_test_layout___pthread_unwind_buf_t() { + const UNINIT: ::core::mem::MaybeUninit<__pthread_unwind_buf_t> = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<__pthread_unwind_buf_t>(), + 104usize, + concat!("Size of: ", stringify!(__pthread_unwind_buf_t)) + ); + assert_eq!( + ::core::mem::align_of::<__pthread_unwind_buf_t>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_unwind_buf_t)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__cancel_jmp_buf) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_unwind_buf_t), + "::", + stringify!(__cancel_jmp_buf) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__pad) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(__pthread_unwind_buf_t), + "::", + stringify!(__pad) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_cleanup_frame { + pub __cancel_routine: + ::core::option::Option, + pub __cancel_arg: *mut ::core::ffi::c_void, + pub __do_it: ::core::ffi::c_int, + pub __cancel_type: ::core::ffi::c_int, +} +#[test] +fn bindgen_test_layout___pthread_cleanup_frame() { + const UNINIT: ::core::mem::MaybeUninit<__pthread_cleanup_frame> = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<__pthread_cleanup_frame>(), + 24usize, + concat!("Size of: ", stringify!(__pthread_cleanup_frame)) + ); + assert_eq!( + ::core::mem::align_of::<__pthread_cleanup_frame>(), + 8usize, + concat!("Alignment of ", stringify!(__pthread_cleanup_frame)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__cancel_routine) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cleanup_frame), + "::", + stringify!(__cancel_routine) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__cancel_arg) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cleanup_frame), + "::", + stringify!(__cancel_arg) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__do_it) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cleanup_frame), + "::", + stringify!(__do_it) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__cancel_type) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(__pthread_cleanup_frame), + "::", + stringify!(__cancel_type) + ) + ); +} +extern "C" { + pub fn __pthread_register_cancel(__buf: *mut __pthread_unwind_buf_t); +} +extern "C" { + pub fn __pthread_unregister_cancel(__buf: *mut __pthread_unwind_buf_t); +} +extern "C" { + pub fn __pthread_unwind_next(__buf: *mut __pthread_unwind_buf_t) -> !; +} +extern "C" { + pub fn __sigsetjmp( + __env: *mut __jmp_buf_tag, + __savemask: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutex_init( + __mutex: *mut pthread_mutex_t, + __mutexattr: *const pthread_mutexattr_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutex_destroy(__mutex: *mut pthread_mutex_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutex_trylock(__mutex: *mut pthread_mutex_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutex_lock(__mutex: *mut pthread_mutex_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutex_timedlock( + __mutex: *mut pthread_mutex_t, + __abstime: *const timespec, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutex_unlock(__mutex: *mut pthread_mutex_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutex_getprioceiling( + __mutex: *const pthread_mutex_t, + __prioceiling: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutex_setprioceiling( + __mutex: *mut pthread_mutex_t, + __prioceiling: ::core::ffi::c_int, + __old_ceiling: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutex_consistent(__mutex: *mut pthread_mutex_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_init(__attr: *mut pthread_mutexattr_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_destroy(__attr: *mut pthread_mutexattr_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_getpshared( + __attr: *const pthread_mutexattr_t, + __pshared: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_setpshared( + __attr: *mut pthread_mutexattr_t, + __pshared: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_gettype( + __attr: *const pthread_mutexattr_t, + __kind: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_settype( + __attr: *mut pthread_mutexattr_t, + __kind: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_getprotocol( + __attr: *const pthread_mutexattr_t, + __protocol: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_setprotocol( + __attr: *mut pthread_mutexattr_t, + __protocol: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_getprioceiling( + __attr: *const pthread_mutexattr_t, + __prioceiling: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_setprioceiling( + __attr: *mut pthread_mutexattr_t, + __prioceiling: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_getrobust( + __attr: *const pthread_mutexattr_t, + __robustness: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_mutexattr_setrobust( + __attr: *mut pthread_mutexattr_t, + __robustness: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlock_init( + __rwlock: *mut pthread_rwlock_t, + __attr: *const pthread_rwlockattr_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlock_destroy(__rwlock: *mut pthread_rwlock_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlock_rdlock(__rwlock: *mut pthread_rwlock_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlock_tryrdlock(__rwlock: *mut pthread_rwlock_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlock_timedrdlock( + __rwlock: *mut pthread_rwlock_t, + __abstime: *const timespec, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlock_wrlock(__rwlock: *mut pthread_rwlock_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlock_trywrlock(__rwlock: *mut pthread_rwlock_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlock_timedwrlock( + __rwlock: *mut pthread_rwlock_t, + __abstime: *const timespec, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlock_unlock(__rwlock: *mut pthread_rwlock_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlockattr_init(__attr: *mut pthread_rwlockattr_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlockattr_destroy(__attr: *mut pthread_rwlockattr_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlockattr_getpshared( + __attr: *const pthread_rwlockattr_t, + __pshared: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlockattr_setpshared( + __attr: *mut pthread_rwlockattr_t, + __pshared: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlockattr_getkind_np( + __attr: *const pthread_rwlockattr_t, + __pref: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_rwlockattr_setkind_np( + __attr: *mut pthread_rwlockattr_t, + __pref: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_cond_init( + __cond: *mut pthread_cond_t, + __cond_attr: *const pthread_condattr_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_cond_destroy(__cond: *mut pthread_cond_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_cond_signal(__cond: *mut pthread_cond_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_cond_broadcast(__cond: *mut pthread_cond_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_cond_wait( + __cond: *mut pthread_cond_t, + __mutex: *mut pthread_mutex_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_cond_timedwait( + __cond: *mut pthread_cond_t, + __mutex: *mut pthread_mutex_t, + __abstime: *const timespec, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_condattr_init(__attr: *mut pthread_condattr_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_condattr_destroy(__attr: *mut pthread_condattr_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_condattr_getpshared( + __attr: *const pthread_condattr_t, + __pshared: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_condattr_setpshared( + __attr: *mut pthread_condattr_t, + __pshared: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_condattr_getclock( + __attr: *const pthread_condattr_t, + __clock_id: *mut __clockid_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_condattr_setclock( + __attr: *mut pthread_condattr_t, + __clock_id: __clockid_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_spin_init( + __lock: *mut pthread_spinlock_t, + __pshared: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_spin_destroy(__lock: *mut pthread_spinlock_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_spin_lock(__lock: *mut pthread_spinlock_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_spin_trylock(__lock: *mut pthread_spinlock_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_spin_unlock(__lock: *mut pthread_spinlock_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_barrier_init( + __barrier: *mut pthread_barrier_t, + __attr: *const pthread_barrierattr_t, + __count: ::core::ffi::c_uint, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_barrier_destroy(__barrier: *mut pthread_barrier_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_barrier_wait(__barrier: *mut pthread_barrier_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_barrierattr_init(__attr: *mut pthread_barrierattr_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_barrierattr_destroy(__attr: *mut pthread_barrierattr_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_barrierattr_getpshared( + __attr: *const pthread_barrierattr_t, + __pshared: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_barrierattr_setpshared( + __attr: *mut pthread_barrierattr_t, + __pshared: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_key_create( + __key: *mut pthread_key_t, + __destr_function: ::core::option::Option< + unsafe extern "C" fn(arg1: *mut ::core::ffi::c_void), + >, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_key_delete(__key: pthread_key_t) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_getspecific(__key: pthread_key_t) -> *mut ::core::ffi::c_void; +} +extern "C" { + pub fn pthread_setspecific( + __key: pthread_key_t, + __pointer: *const ::core::ffi::c_void, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_getcpuclockid( + __thread_id: pthread_t, + __clock_id: *mut __clockid_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pthread_atfork( + __prepare: ::core::option::Option, + __parent: ::core::option::Option, + __child: ::core::option::Option, + ) -> ::core::ffi::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct iovec { + pub iov_base: *mut ::core::ffi::c_void, + pub iov_len: usize, +} +#[test] +fn bindgen_test_layout_iovec() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(iovec)) + ); + assert_eq!( + ::core::mem::align_of::(), + 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) + ) + ); +} +pub type u_char = __u_char; +pub type u_short = __u_short; +pub type u_int = __u_int; +pub type u_long = __u_long; +pub type quad_t = __quad_t; +pub type u_quad_t = __u_quad_t; +pub type fsid_t = __fsid_t; +pub type loff_t = __loff_t; +pub type ino_t = __ino_t; +pub type dev_t = __dev_t; +pub type gid_t = __gid_t; +pub type mode_t = __mode_t; +pub type nlink_t = __nlink_t; +pub type uid_t = __uid_t; +pub type off_t = __off_t; +pub type id_t = __id_t; +pub type daddr_t = __daddr_t; +pub type caddr_t = __caddr_t; +pub type key_t = __key_t; +pub type ulong = ::core::ffi::c_ulong; +pub type ushort = ::core::ffi::c_ushort; +pub type uint = ::core::ffi::c_uint; +pub type u_int8_t = __uint8_t; +pub type u_int16_t = __uint16_t; +pub type u_int32_t = __uint32_t; +pub type u_int64_t = __uint64_t; +pub type register_t = ::core::ffi::c_long; +pub type sigset_t = __sigset_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timeval { + pub tv_sec: __time_t, + pub tv_usec: __suseconds_t, +} +#[test] +fn bindgen_test_layout_timeval() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(timeval)) + ); + assert_eq!( + ::core::mem::align_of::(), + 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) + ) + ); +} +pub type suseconds_t = __suseconds_t; +pub type __fd_mask = ::core::ffi::c_long; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fd_set { + pub __fds_bits: [__fd_mask; 16usize], +} +#[test] +fn bindgen_test_layout_fd_set() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 128usize, + concat!("Size of: ", stringify!(fd_set)) + ); + assert_eq!( + ::core::mem::align_of::(), + 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) + ) + ); +} +pub type fd_mask = __fd_mask; +extern "C" { + pub fn select( + __nfds: ::core::ffi::c_int, + __readfds: *mut fd_set, + __writefds: *mut fd_set, + __exceptfds: *mut fd_set, + __timeout: *mut timeval, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn pselect( + __nfds: ::core::ffi::c_int, + __readfds: *mut fd_set, + __writefds: *mut fd_set, + __exceptfds: *mut fd_set, + __timeout: *const timespec, + __sigmask: *const __sigset_t, + ) -> ::core::ffi::c_int; +} +pub type blksize_t = __blksize_t; +pub type blkcnt_t = __blkcnt_t; +pub type fsblkcnt_t = __fsblkcnt_t; +pub type fsfilcnt_t = __fsfilcnt_t; +pub type socklen_t = __socklen_t; +pub const __socket_type_SOCK_STREAM: __socket_type = 1; +pub const __socket_type_SOCK_DGRAM: __socket_type = 2; +pub const __socket_type_SOCK_RAW: __socket_type = 3; +pub const __socket_type_SOCK_RDM: __socket_type = 4; +pub const __socket_type_SOCK_SEQPACKET: __socket_type = 5; +pub const __socket_type_SOCK_DCCP: __socket_type = 6; +pub const __socket_type_SOCK_PACKET: __socket_type = 10; +pub const __socket_type_SOCK_CLOEXEC: __socket_type = 524288; +pub const __socket_type_SOCK_NONBLOCK: __socket_type = 2048; +pub type __socket_type = ::core::ffi::c_uint; +pub type sa_family_t = ::core::ffi::c_ushort; +#[repr(C)] +#[derive(Debug, 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 = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(sockaddr)) + ); + assert_eq!( + ::core::mem::align_of::(), + 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 = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 128usize, + concat!("Size of: ", stringify!(sockaddr_storage)) + ); + assert_eq!( + ::core::mem::align_of::(), + 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) + ) + ); +} +pub const MSG_OOB: _bindgen_ty_11 = 1; +pub const MSG_PEEK: _bindgen_ty_11 = 2; +pub const MSG_DONTROUTE: _bindgen_ty_11 = 4; +pub const MSG_CTRUNC: _bindgen_ty_11 = 8; +pub const MSG_PROXY: _bindgen_ty_11 = 16; +pub const MSG_TRUNC: _bindgen_ty_11 = 32; +pub const MSG_DONTWAIT: _bindgen_ty_11 = 64; +pub const MSG_EOR: _bindgen_ty_11 = 128; +pub const MSG_WAITALL: _bindgen_ty_11 = 256; +pub const MSG_FIN: _bindgen_ty_11 = 512; +pub const MSG_SYN: _bindgen_ty_11 = 1024; +pub const MSG_CONFIRM: _bindgen_ty_11 = 2048; +pub const MSG_RST: _bindgen_ty_11 = 4096; +pub const MSG_ERRQUEUE: _bindgen_ty_11 = 8192; +pub const MSG_NOSIGNAL: _bindgen_ty_11 = 16384; +pub const MSG_MORE: _bindgen_ty_11 = 32768; +pub const MSG_WAITFORONE: _bindgen_ty_11 = 65536; +pub const MSG_BATCH: _bindgen_ty_11 = 262144; +pub const MSG_ZEROCOPY: _bindgen_ty_11 = 67108864; +pub const MSG_FASTOPEN: _bindgen_ty_11 = 536870912; +pub const MSG_CMSG_CLOEXEC: _bindgen_ty_11 = 1073741824; +pub type _bindgen_ty_11 = ::core::ffi::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct msghdr { + pub msg_name: *mut ::core::ffi::c_void, + pub msg_namelen: socklen_t, + pub msg_iov: *mut iovec, + pub msg_iovlen: usize, + pub msg_control: *mut ::core::ffi::c_void, + pub msg_controllen: usize, + pub msg_flags: ::core::ffi::c_int, +} +#[test] +fn bindgen_test_layout_msghdr() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(msghdr)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(msghdr)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_name) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_namelen) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_namelen) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_iov) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_iov) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_iovlen) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_iovlen) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_control) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_control) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_controllen) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_controllen) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).msg_flags) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(msghdr), + "::", + stringify!(msg_flags) + ) + ); +} +#[repr(C)] +#[derive(Debug)] +pub struct cmsghdr { + pub cmsg_len: usize, + pub cmsg_level: ::core::ffi::c_int, + pub cmsg_type: ::core::ffi::c_int, + pub __cmsg_data: __IncompleteArrayField<::core::ffi::c_uchar>, +} +#[test] +fn bindgen_test_layout_cmsghdr() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(cmsghdr)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(cmsghdr)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cmsg_len) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(cmsghdr), + "::", + stringify!(cmsg_len) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cmsg_level) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(cmsghdr), + "::", + stringify!(cmsg_level) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).cmsg_type) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(cmsghdr), + "::", + stringify!(cmsg_type) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__cmsg_data) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(cmsghdr), + "::", + stringify!(__cmsg_data) + ) + ); +} +extern "C" { + pub fn __cmsg_nxthdr(__mhdr: *mut msghdr, __cmsg: *mut cmsghdr) -> *mut cmsghdr; +} +pub const SCM_RIGHTS: _bindgen_ty_12 = 1; +pub type _bindgen_ty_12 = ::core::ffi::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __kernel_fd_set { + pub fds_bits: [::core::ffi::c_ulong; 16usize], +} +#[test] +fn bindgen_test_layout___kernel_fd_set() { + const UNINIT: ::core::mem::MaybeUninit<__kernel_fd_set> = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<__kernel_fd_set>(), + 128usize, + concat!("Size of: ", stringify!(__kernel_fd_set)) + ); + assert_eq!( + ::core::mem::align_of::<__kernel_fd_set>(), + 8usize, + concat!("Alignment of ", stringify!(__kernel_fd_set)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__kernel_fd_set), + "::", + stringify!(fds_bits) + ) + ); +} +pub type __kernel_sighandler_t = + ::core::option::Option; +pub type __kernel_key_t = ::core::ffi::c_int; +pub type __kernel_mqd_t = ::core::ffi::c_int; +pub type __kernel_old_uid_t = ::core::ffi::c_ushort; +pub type __kernel_old_gid_t = ::core::ffi::c_ushort; +pub type __kernel_old_dev_t = ::core::ffi::c_ulong; +pub type __kernel_long_t = ::core::ffi::c_long; +pub type __kernel_ulong_t = ::core::ffi::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = ::core::ffi::c_uint; +pub type __kernel_pid_t = ::core::ffi::c_int; +pub type __kernel_ipc_pid_t = ::core::ffi::c_int; +pub type __kernel_uid_t = ::core::ffi::c_uint; +pub type __kernel_gid_t = ::core::ffi::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = ::core::ffi::c_int; +pub type __kernel_uid32_t = ::core::ffi::c_uint; +pub type __kernel_gid32_t = ::core::ffi::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __kernel_fsid_t { + pub val: [::core::ffi::c_int; 2usize], +} +#[test] +fn bindgen_test_layout___kernel_fsid_t() { + const UNINIT: ::core::mem::MaybeUninit<__kernel_fsid_t> = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<__kernel_fsid_t>(), + 8usize, + concat!("Size of: ", stringify!(__kernel_fsid_t)) + ); + assert_eq!( + ::core::mem::align_of::<__kernel_fsid_t>(), + 4usize, + concat!("Alignment of ", stringify!(__kernel_fsid_t)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__kernel_fsid_t), + "::", + stringify!(val) + ) + ); +} +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = ::core::ffi::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = ::core::ffi::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = ::core::ffi::c_int; +pub type __kernel_clockid_t = ::core::ffi::c_int; +pub type __kernel_caddr_t = *mut ::core::ffi::c_char; +pub type __kernel_uid16_t = ::core::ffi::c_ushort; +pub type __kernel_gid16_t = ::core::ffi::c_ushort; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct linger { + pub l_onoff: ::core::ffi::c_int, + pub l_linger: ::core::ffi::c_int, +} +#[test] +fn bindgen_test_layout_linger() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(linger)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(linger)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).l_onoff) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(linger), + "::", + stringify!(l_onoff) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).l_linger) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(linger), + "::", + stringify!(l_linger) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct osockaddr { + pub sa_family: ::core::ffi::c_ushort, + pub sa_data: [::core::ffi::c_uchar; 14usize], +} +#[test] +fn bindgen_test_layout_osockaddr() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(osockaddr)) + ); + assert_eq!( + ::core::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(osockaddr)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sa_family) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(osockaddr), + "::", + stringify!(sa_family) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sa_data) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(osockaddr), + "::", + stringify!(sa_data) + ) + ); +} +pub const SHUT_RD: _bindgen_ty_13 = 0; +pub const SHUT_WR: _bindgen_ty_13 = 1; +pub const SHUT_RDWR: _bindgen_ty_13 = 2; +pub type _bindgen_ty_13 = ::core::ffi::c_uint; +extern "C" { + pub fn socket( + __domain: ::core::ffi::c_int, + __type: ::core::ffi::c_int, + __protocol: ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn socketpair( + __domain: ::core::ffi::c_int, + __type: ::core::ffi::c_int, + __protocol: ::core::ffi::c_int, + __fds: *mut ::core::ffi::c_int, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn bind( + __fd: ::core::ffi::c_int, + __addr: *const sockaddr, + __len: socklen_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn getsockname( + __fd: ::core::ffi::c_int, + __addr: *mut sockaddr, + __len: *mut socklen_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn connect( + __fd: ::core::ffi::c_int, + __addr: *const sockaddr, + __len: socklen_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn getpeername( + __fd: ::core::ffi::c_int, + __addr: *mut sockaddr, + __len: *mut socklen_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn send( + __fd: ::core::ffi::c_int, + __buf: *const ::core::ffi::c_void, + __n: usize, + __flags: ::core::ffi::c_int, + ) -> isize; +} +extern "C" { + pub fn recv( + __fd: ::core::ffi::c_int, + __buf: *mut ::core::ffi::c_void, + __n: usize, + __flags: ::core::ffi::c_int, + ) -> isize; +} +extern "C" { + pub fn sendto( + __fd: ::core::ffi::c_int, + __buf: *const ::core::ffi::c_void, + __n: usize, + __flags: ::core::ffi::c_int, + __addr: *const sockaddr, + __addr_len: socklen_t, + ) -> isize; +} +extern "C" { + pub fn recvfrom( + __fd: ::core::ffi::c_int, + __buf: *mut ::core::ffi::c_void, + __n: usize, + __flags: ::core::ffi::c_int, + __addr: *mut sockaddr, + __addr_len: *mut socklen_t, + ) -> isize; +} +extern "C" { + pub fn sendmsg( + __fd: ::core::ffi::c_int, + __message: *const msghdr, + __flags: ::core::ffi::c_int, + ) -> isize; +} +extern "C" { + pub fn recvmsg( + __fd: ::core::ffi::c_int, + __message: *mut msghdr, + __flags: ::core::ffi::c_int, + ) -> isize; +} +extern "C" { + pub fn getsockopt( + __fd: ::core::ffi::c_int, + __level: ::core::ffi::c_int, + __optname: ::core::ffi::c_int, + __optval: *mut ::core::ffi::c_void, + __optlen: *mut socklen_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn setsockopt( + __fd: ::core::ffi::c_int, + __level: ::core::ffi::c_int, + __optname: ::core::ffi::c_int, + __optval: *const ::core::ffi::c_void, + __optlen: socklen_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn listen(__fd: ::core::ffi::c_int, __n: ::core::ffi::c_int) -> ::core::ffi::c_int; +} +extern "C" { + pub fn accept( + __fd: ::core::ffi::c_int, + __addr: *mut sockaddr, + __addr_len: *mut socklen_t, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn shutdown(__fd: ::core::ffi::c_int, __how: ::core::ffi::c_int) -> ::core::ffi::c_int; +} +extern "C" { + pub fn sockatmark(__fd: ::core::ffi::c_int) -> ::core::ffi::c_int; +} +extern "C" { + pub fn isfdtype(__fd: ::core::ffi::c_int, __fdtype: ::core::ffi::c_int) -> ::core::ffi::c_int; +} +pub type in_addr_t = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct in_addr { + pub s_addr: in_addr_t, +} +#[test] +fn bindgen_test_layout_in_addr() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(in_addr)) + ); + assert_eq!( + ::core::mem::align_of::(), + 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, Copy, Clone)] +pub struct ip_opts { + pub ip_dst: in_addr, + pub ip_opts: [::core::ffi::c_char; 40usize], +} +#[test] +fn bindgen_test_layout_ip_opts() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 44usize, + concat!("Size of: ", stringify!(ip_opts)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ip_opts)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ip_dst) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ip_opts), + "::", + stringify!(ip_dst) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ip_opts) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ip_opts), + "::", + stringify!(ip_opts) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip_mreqn { + pub imr_multiaddr: in_addr, + pub imr_address: in_addr, + pub imr_ifindex: ::core::ffi::c_int, +} +#[test] +fn bindgen_test_layout_ip_mreqn() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(ip_mreqn)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ip_mreqn)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imr_multiaddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ip_mreqn), + "::", + stringify!(imr_multiaddr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imr_address) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ip_mreqn), + "::", + stringify!(imr_address) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imr_ifindex) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ip_mreqn), + "::", + stringify!(imr_ifindex) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct in_pktinfo { + pub ipi_ifindex: ::core::ffi::c_int, + pub ipi_spec_dst: in_addr, + pub ipi_addr: in_addr, +} +#[test] +fn bindgen_test_layout_in_pktinfo() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(in_pktinfo)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(in_pktinfo)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ipi_ifindex) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in_pktinfo), + "::", + stringify!(ipi_ifindex) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ipi_spec_dst) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(in_pktinfo), + "::", + stringify!(ipi_spec_dst) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ipi_addr) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(in_pktinfo), + "::", + stringify!(ipi_addr) + ) + ); +} +pub const IPPROTO_IP: _bindgen_ty_14 = 0; +pub const IPPROTO_ICMP: _bindgen_ty_14 = 1; +pub const IPPROTO_IGMP: _bindgen_ty_14 = 2; +pub const IPPROTO_IPIP: _bindgen_ty_14 = 4; +pub const IPPROTO_TCP: _bindgen_ty_14 = 6; +pub const IPPROTO_EGP: _bindgen_ty_14 = 8; +pub const IPPROTO_PUP: _bindgen_ty_14 = 12; +pub const IPPROTO_UDP: _bindgen_ty_14 = 17; +pub const IPPROTO_IDP: _bindgen_ty_14 = 22; +pub const IPPROTO_TP: _bindgen_ty_14 = 29; +pub const IPPROTO_DCCP: _bindgen_ty_14 = 33; +pub const IPPROTO_IPV6: _bindgen_ty_14 = 41; +pub const IPPROTO_RSVP: _bindgen_ty_14 = 46; +pub const IPPROTO_GRE: _bindgen_ty_14 = 47; +pub const IPPROTO_ESP: _bindgen_ty_14 = 50; +pub const IPPROTO_AH: _bindgen_ty_14 = 51; +pub const IPPROTO_MTP: _bindgen_ty_14 = 92; +pub const IPPROTO_BEETPH: _bindgen_ty_14 = 94; +pub const IPPROTO_ENCAP: _bindgen_ty_14 = 98; +pub const IPPROTO_PIM: _bindgen_ty_14 = 103; +pub const IPPROTO_COMP: _bindgen_ty_14 = 108; +pub const IPPROTO_SCTP: _bindgen_ty_14 = 132; +pub const IPPROTO_UDPLITE: _bindgen_ty_14 = 136; +pub const IPPROTO_MPLS: _bindgen_ty_14 = 137; +pub const IPPROTO_ETHERNET: _bindgen_ty_14 = 143; +pub const IPPROTO_RAW: _bindgen_ty_14 = 255; +pub const IPPROTO_MPTCP: _bindgen_ty_14 = 262; +pub const IPPROTO_MAX: _bindgen_ty_14 = 263; +pub type _bindgen_ty_14 = ::core::ffi::c_uint; +pub const IPPROTO_HOPOPTS: _bindgen_ty_15 = 0; +pub const IPPROTO_ROUTING: _bindgen_ty_15 = 43; +pub const IPPROTO_FRAGMENT: _bindgen_ty_15 = 44; +pub const IPPROTO_ICMPV6: _bindgen_ty_15 = 58; +pub const IPPROTO_NONE: _bindgen_ty_15 = 59; +pub const IPPROTO_DSTOPTS: _bindgen_ty_15 = 60; +pub const IPPROTO_MH: _bindgen_ty_15 = 135; +pub type _bindgen_ty_15 = ::core::ffi::c_uint; +pub type in_port_t = u16; +pub const IPPORT_ECHO: _bindgen_ty_16 = 7; +pub const IPPORT_DISCARD: _bindgen_ty_16 = 9; +pub const IPPORT_SYSTAT: _bindgen_ty_16 = 11; +pub const IPPORT_DAYTIME: _bindgen_ty_16 = 13; +pub const IPPORT_NETSTAT: _bindgen_ty_16 = 15; +pub const IPPORT_FTP: _bindgen_ty_16 = 21; +pub const IPPORT_TELNET: _bindgen_ty_16 = 23; +pub const IPPORT_SMTP: _bindgen_ty_16 = 25; +pub const IPPORT_TIMESERVER: _bindgen_ty_16 = 37; +pub const IPPORT_NAMESERVER: _bindgen_ty_16 = 42; +pub const IPPORT_WHOIS: _bindgen_ty_16 = 43; +pub const IPPORT_MTP: _bindgen_ty_16 = 57; +pub const IPPORT_TFTP: _bindgen_ty_16 = 69; +pub const IPPORT_RJE: _bindgen_ty_16 = 77; +pub const IPPORT_FINGER: _bindgen_ty_16 = 79; +pub const IPPORT_TTYLINK: _bindgen_ty_16 = 87; +pub const IPPORT_SUPDUP: _bindgen_ty_16 = 95; +pub const IPPORT_EXECSERVER: _bindgen_ty_16 = 512; +pub const IPPORT_LOGINSERVER: _bindgen_ty_16 = 513; +pub const IPPORT_CMDSERVER: _bindgen_ty_16 = 514; +pub const IPPORT_EFSSERVER: _bindgen_ty_16 = 520; +pub const IPPORT_BIFFUDP: _bindgen_ty_16 = 512; +pub const IPPORT_WHOSERVER: _bindgen_ty_16 = 513; +pub const IPPORT_ROUTESERVER: _bindgen_ty_16 = 520; +pub const IPPORT_RESERVED: _bindgen_ty_16 = 1024; +pub const IPPORT_USERRESERVED: _bindgen_ty_16 = 5000; +pub type _bindgen_ty_16 = ::core::ffi::c_uint; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct in6_addr { + pub __in6_u: in6_addr__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union in6_addr__bindgen_ty_1 { + pub __u6_addr8: [u8; 16usize], + pub __u6_addr16: [u16; 8usize], + pub __u6_addr32: [u32; 4usize], +} +#[test] +fn bindgen_test_layout_in6_addr__bindgen_ty_1() { + const UNINIT: ::core::mem::MaybeUninit = + ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(in6_addr__bindgen_ty_1)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(in6_addr__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__u6_addr8) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr8) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__u6_addr16) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr16) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__u6_addr32) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr__bindgen_ty_1), + "::", + stringify!(__u6_addr32) + ) + ); +} +#[test] +fn bindgen_test_layout_in6_addr() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(in6_addr)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(in6_addr)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).__in6_u) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(in6_addr), + "::", + stringify!(__in6_u) + ) + ); +} +extern "C" { + pub static in6addr_any: in6_addr; +} +extern "C" { + pub static in6addr_loopback: in6_addr; +} +#[repr(C)] +#[derive(Debug, 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: [::core::ffi::c_uchar; 8usize], +} +#[test] +fn bindgen_test_layout_sockaddr_in() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(sockaddr_in)) + ); + assert_eq!( + ::core::mem::align_of::(), + 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 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 = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 28usize, + concat!("Size of: ", stringify!(sockaddr_in6)) + ); + assert_eq!( + ::core::mem::align_of::(), + 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) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, +} +#[test] +fn bindgen_test_layout_ip_mreq() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(ip_mreq)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ip_mreq)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imr_multiaddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ip_mreq), + "::", + stringify!(imr_multiaddr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imr_interface) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ip_mreq), + "::", + stringify!(imr_interface) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip_mreq_source { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + pub imr_sourceaddr: in_addr, +} +#[test] +fn bindgen_test_layout_ip_mreq_source() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(ip_mreq_source)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ip_mreq_source)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imr_multiaddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ip_mreq_source), + "::", + stringify!(imr_multiaddr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imr_interface) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ip_mreq_source), + "::", + stringify!(imr_interface) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imr_sourceaddr) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ip_mreq_source), + "::", + stringify!(imr_sourceaddr) + ) + ); +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct ipv6_mreq { + pub ipv6mr_multiaddr: in6_addr, + pub ipv6mr_interface: ::core::ffi::c_uint, +} +#[test] +fn bindgen_test_layout_ipv6_mreq() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(ipv6_mreq)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ipv6_mreq)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ipv6mr_multiaddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ipv6_mreq), + "::", + stringify!(ipv6mr_multiaddr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).ipv6mr_interface) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ipv6_mreq), + "::", + stringify!(ipv6mr_interface) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct group_req { + pub gr_interface: u32, + pub gr_group: sockaddr_storage, +} +#[test] +fn bindgen_test_layout_group_req() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 136usize, + concat!("Size of: ", stringify!(group_req)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(group_req)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gr_interface) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(group_req), + "::", + stringify!(gr_interface) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gr_group) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(group_req), + "::", + stringify!(gr_group) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct group_source_req { + pub gsr_interface: u32, + pub gsr_group: sockaddr_storage, + pub gsr_source: sockaddr_storage, +} +#[test] +fn bindgen_test_layout_group_source_req() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 264usize, + concat!("Size of: ", stringify!(group_source_req)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(group_source_req)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gsr_interface) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(group_source_req), + "::", + stringify!(gsr_interface) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gsr_group) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(group_source_req), + "::", + stringify!(gsr_group) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gsr_source) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(group_source_req), + "::", + stringify!(gsr_source) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip_msfilter { + pub imsf_multiaddr: in_addr, + pub imsf_interface: in_addr, + pub imsf_fmode: u32, + pub imsf_numsrc: u32, + pub imsf_slist: [in_addr; 1usize], +} +#[test] +fn bindgen_test_layout_ip_msfilter() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(ip_msfilter)) + ); + assert_eq!( + ::core::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ip_msfilter)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imsf_multiaddr) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ip_msfilter), + "::", + stringify!(imsf_multiaddr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imsf_interface) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ip_msfilter), + "::", + stringify!(imsf_interface) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imsf_fmode) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ip_msfilter), + "::", + stringify!(imsf_fmode) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imsf_numsrc) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(ip_msfilter), + "::", + stringify!(imsf_numsrc) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).imsf_slist) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ip_msfilter), + "::", + stringify!(imsf_slist) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct group_filter { + pub gf_interface: u32, + pub gf_group: sockaddr_storage, + pub gf_fmode: u32, + pub gf_numsrc: u32, + pub gf_slist: [sockaddr_storage; 1usize], +} +#[test] +fn bindgen_test_layout_group_filter() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 272usize, + concat!("Size of: ", stringify!(group_filter)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(group_filter)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gf_interface) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(group_filter), + "::", + stringify!(gf_interface) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gf_group) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(group_filter), + "::", + stringify!(gf_group) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gf_fmode) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(group_filter), + "::", + stringify!(gf_fmode) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gf_numsrc) as usize - ptr as usize }, + 140usize, + concat!( + "Offset of field: ", + stringify!(group_filter), + "::", + stringify!(gf_numsrc) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gf_slist) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(group_filter), + "::", + stringify!(gf_slist) + ) + ); +} +extern "C" { + pub fn ntohl(__netlong: u32) -> u32; +} +extern "C" { + pub fn ntohs(__netshort: u16) -> u16; +} +extern "C" { + pub fn htonl(__hostlong: u32) -> u32; +} +extern "C" { + pub fn htons(__hostshort: u16) -> u16; +} +extern "C" { + pub fn bindresvport( + __sockfd: ::core::ffi::c_int, + __sock_in: *mut sockaddr_in, + ) -> ::core::ffi::c_int; +} +extern "C" { + pub fn bindresvport6( + __sockfd: ::core::ffi::c_int, + __sock_in: *mut sockaddr_in6, + ) -> ::core::ffi::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct csp_if_udp_conf_t { + pub host: *mut ::core::ffi::c_char, + pub lport: ::core::ffi::c_int, + pub rport: ::core::ffi::c_int, + pub server_handle: pthread_t, + pub peer_addr: sockaddr_in, + pub sockfd: ::core::ffi::c_int, +} +#[test] +fn bindgen_test_layout_csp_if_udp_conf_t() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(csp_if_udp_conf_t)) + ); + assert_eq!( + ::core::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(csp_if_udp_conf_t)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).host) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(csp_if_udp_conf_t), + "::", + stringify!(host) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).lport) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(csp_if_udp_conf_t), + "::", + stringify!(lport) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).rport) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(csp_if_udp_conf_t), + "::", + stringify!(rport) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).server_handle) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(csp_if_udp_conf_t), + "::", + stringify!(server_handle) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).peer_addr) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(csp_if_udp_conf_t), + "::", + stringify!(peer_addr) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).sockfd) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(csp_if_udp_conf_t), + "::", + stringify!(sockfd) + ) + ); +} +extern "C" { + #[doc = " Setup UDP peer\n\n RX task:\n A server task will attempt at binding to ip 0.0.0.0 port 9600\n If this fails, it is because another udp server is already running.\n The server task will continue attemting the bind and will not exit before the application is closed.\n\n TX peer:\n Outgoing CSP packets will be transferred to the peer specified by the host argument"] + pub fn csp_if_udp_init(iface: *mut csp_iface_t, ifconf: *mut csp_if_udp_conf_t); +} +pub const memory_order_memory_order_relaxed: memory_order = 0; +pub const memory_order_memory_order_consume: memory_order = 1; +pub const memory_order_memory_order_acquire: memory_order = 2; +pub const memory_order_memory_order_release: memory_order = 3; +pub const memory_order_memory_order_acq_rel: memory_order = 4; +pub const memory_order_memory_order_seq_cst: memory_order = 5; +pub type memory_order = ::core::ffi::c_uint; +extern "C" { + pub fn atomic_thread_fence(arg1: memory_order); +} +extern "C" { + pub fn atomic_signal_fence(arg1: memory_order); +} +pub type atomic_bool = u8; +pub type atomic_char = u8; +pub type atomic_schar = u8; +pub type atomic_uchar = u8; +pub type atomic_short = u16; +pub type atomic_ushort = u16; +pub type atomic_int = u32; +pub type atomic_uint = u32; +pub type atomic_long = u64; +pub type atomic_ulong = u64; +pub type atomic_llong = u64; +pub type atomic_ullong = u64; +pub type atomic_char16_t = u16; +pub type atomic_char32_t = u32; +pub type atomic_wchar_t = u32; +pub type atomic_int_least8_t = u8; +pub type atomic_uint_least8_t = u8; +pub type atomic_int_least16_t = u16; +pub type atomic_uint_least16_t = u16; +pub type atomic_int_least32_t = u32; +pub type atomic_uint_least32_t = u32; +pub type atomic_int_least64_t = u64; +pub type atomic_uint_least64_t = u64; +pub type atomic_int_fast8_t = u8; +pub type atomic_uint_fast8_t = u8; +pub type atomic_int_fast16_t = u64; +pub type atomic_uint_fast16_t = u64; +pub type atomic_int_fast32_t = u64; +pub type atomic_uint_fast32_t = u64; +pub type atomic_int_fast64_t = u64; +pub type atomic_uint_fast64_t = u64; +pub type atomic_intptr_t = u64; +pub type atomic_uintptr_t = u64; +pub type atomic_size_t = u64; +pub type atomic_ptrdiff_t = u64; +pub type atomic_intmax_t = u64; +pub type atomic_uintmax_t = u64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct atomic_flag { + pub _Value: atomic_bool, +} +#[test] +fn bindgen_test_layout_atomic_flag() { + const UNINIT: ::core::mem::MaybeUninit = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(atomic_flag)) + ); + assert_eq!( + ::core::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(atomic_flag)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr)._Value) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(atomic_flag), + "::", + stringify!(_Value) + ) + ); +} +extern "C" { + pub fn atomic_flag_test_and_set(arg1: *mut atomic_flag) -> bool; +} +extern "C" { + pub fn atomic_flag_test_and_set_explicit(arg1: *mut atomic_flag, arg2: memory_order) -> bool; +} +extern "C" { + pub fn atomic_flag_clear(arg1: *mut atomic_flag); +} +extern "C" { + pub fn atomic_flag_clear_explicit(arg1: *mut atomic_flag, arg2: memory_order); +} #[repr(C)] #[derive(Copy, Clone)] pub union sem_t { diff --git a/clib/gen-bindings.sh b/clib/gen-bindings.sh index e94116f..c0cfb0f 100755 --- a/clib/gen-bindings.sh +++ b/clib/gen-bindings.sh @@ -1,2 +1,4 @@ #!/bin/bash -bindgen --use-core wrapper.h -- "-I./libcsp/include" "-I./cfg" "-I./libcsp/src" > bindings.rs +bindgen_cmd="bindgen --use-core wrapper.h -- '-I./libcsp/include' '-I./cfg' '-I./libcsp/src' > bindings.rs" +echo "Running: $bindgen_cmd" +eval $bindgen_cmd diff --git a/clib/wrapper.h b/clib/wrapper.h index 9c33746..6bdb874 100644 --- a/clib/wrapper.h +++ b/clib/wrapper.h @@ -1,2 +1,4 @@ #include "csp/csp.h" +#include "csp/interfaces/csp_if_lo.h" +#include "csp/interfaces/csp_if_udp.h" #include "csp_conn.h" diff --git a/examples/build.rs b/examples/build.rs index f2a7442..6d53417 100644 --- a/examples/build.rs +++ b/examples/build.rs @@ -6,8 +6,8 @@ fn main() { let out_dir = env::var("OUT_DIR").unwrap_or_default(); let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap_or_default(); let manifest_path = PathBuf::from(&manifest_dir); - let lib_cfg_dir = "../lib/cfg/csp"; - let libcsp_path = "../lib/libcsp"; + let lib_cfg_dir = "../clib/cfg/csp"; + let libcsp_path = "../clib/libcsp"; // This helper structure will take care of the majority of work to compile libcsp using the // cc crate. diff --git a/libcsp/src/lib.rs b/libcsp/src/lib.rs index bcb2b6d..dd4dd81 100644 --- a/libcsp/src/lib.rs +++ b/libcsp/src/lib.rs @@ -350,6 +350,21 @@ pub fn csp_read_guarded(conn: &mut CspConnRef, timeout: Duration) -> Option Option { + let opt_packet = unsafe { ffi::csp_recvfrom(&mut socket.0, timeout) }; + if opt_packet.is_null() { + return None; + } + Some(CspPacketRef(unsafe { &mut *opt_packet })) +} + +/// Rust wrapper for [ffi::csp_recvfrom] which returns a guarded packet reference. This packet +/// will cleaned up automatically with [csp_buffer_free] on drop. +pub fn csp_recvfrom_guarded(socket: &mut CspSocket, timeout: u32) -> Option { + Some(CspPacketRefGuard(Some(csp_recvfrom(socket, timeout)?))) +} + /// Rust wrapper for [ffi::csp_conn_dport]. pub fn csp_conn_dport(conn: &CspConnRef) -> i32 { // SAFETY: FFI call. @@ -507,3 +522,38 @@ pub fn csp_transaction_persistent( ) } } + +/// Rust wrapper for [ffi::csp_transaction_w_opts]. +/// +/// # Parameters +/// +/// * `in_len`: Use [None] if the length is unknown, and the expected reply length otherwise. +/// +/// # Returns +/// +/// 1 or reply size on success, 0 otherwise. +#[allow(clippy::too_many_arguments)] +pub fn csp_transaction_w_opts( + prio: MsgPriority, + dst: u16, + dst_port: u8, + timeout: Duration, + out_data: &[u8], + in_data: &mut [u8], + in_len: Option, + opts: ConnectOpts, +) -> i32 { + unsafe { + ffi::csp_transaction_w_opts( + prio as u8, + dst, + dst_port, + timeout.as_millis() as u32, + out_data.as_ptr() as *const core::ffi::c_void, + out_data.len() as i32, + in_data.as_ptr() as *mut core::ffi::c_void, + in_len.map(|v| v as i32).unwrap_or(-1), + opts.bits(), + ) + } +}