diff options
Diffstat (limited to 'vendor/libc/src/unix/bsd/freebsdlike')
6 files changed, 986 insertions, 50 deletions
diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs index 563c0f936..f2d170fb2 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs @@ -462,8 +462,8 @@ extern "C" { msgflg: ::c_int, ) -> ::c_int; - pub fn fdatasync(fd: ::c_int) -> ::c_int; - + // Type of `path` argument changed from `const void*` to `void*` + // in FreeBSD 12 pub fn dirname(path: *const ::c_char) -> *mut ::c_char; pub fn basename(path: *const ::c_char) -> *mut ::c_char; } diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs index df00b6c1d..5cd4eff26 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs @@ -473,20 +473,6 @@ extern "C" { msgtyp: ::c_long, msgflg: ::c_int, ) -> ::ssize_t; - pub fn clock_nanosleep( - clk_id: ::clockid_t, - flags: ::c_int, - rqtp: *const ::timespec, - rmtp: *mut ::timespec, - ) -> ::c_int; - - pub fn fdatasync(fd: ::c_int) -> ::c_int; - - pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; - pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int; - pub fn setproctitle_fast(fmt: *const ::c_char, ...); - pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; - pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; pub fn dirname(path: *mut ::c_char) -> *mut ::c_char; pub fn basename(path: *mut ::c_char) -> *mut ::c_char; diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs index 72a38dc22..56564eeb4 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs @@ -492,23 +492,6 @@ extern "C" { msgtyp: ::c_long, msgflg: ::c_int, ) -> ::ssize_t; - pub fn clock_nanosleep( - clk_id: ::clockid_t, - flags: ::c_int, - rqtp: *const ::timespec, - rmtp: *mut ::timespec, - ) -> ::c_int; - - pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; - - pub fn fdatasync(fd: ::c_int) -> ::c_int; - - pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; - pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; - pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int; - pub fn setproctitle_fast(fmt: *const ::c_char, ...); - pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; - pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; pub fn cpuset_getdomain( level: ::cpulevel_t, diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs index 115b47764..d60f1a174 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs @@ -492,23 +492,6 @@ extern "C" { msgtyp: ::c_long, msgflg: ::c_int, ) -> ::ssize_t; - pub fn clock_nanosleep( - clk_id: ::clockid_t, - flags: ::c_int, - rqtp: *const ::timespec, - rmtp: *mut ::timespec, - ) -> ::c_int; - - pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; - - pub fn fdatasync(fd: ::c_int) -> ::c_int; - - pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; - pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; - pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int; - pub fn setproctitle_fast(fmt: *const ::c_char, ...); - pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; - pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; pub fn cpuset_getdomain( level: ::cpulevel_t, diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs index 2a4fbbf05..b70a40f15 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -46,6 +46,8 @@ pub type au_asid_t = ::pid_t; pub type cpusetid_t = ::c_int; +pub type sctp_assoc_t = u32; + #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] #[repr(u32)] pub enum devstat_support_flags { @@ -355,6 +357,13 @@ s! { pub pc_limit: ::off_t, } + pub struct ptrace_sc_remote { + pub pscr_ret: ptrace_sc_ret, + pub pscr_syscall: ::c_uint, + pub pscr_nargs: ::c_uint, + pub pscr_args: *mut ::register_t, + } + pub struct cpuset_t { #[cfg(target_pointer_width = "64")] __bits: [::c_long; 4], @@ -987,6 +996,68 @@ s! { pub pcbcnt: u32, } + pub struct tcp_info { + pub tcpi_state: u8, + pub __tcpi_ca_state: u8, + pub __tcpi_retransmits: u8, + pub __tcpi_probes: u8, + pub __tcpi_backoff: u8, + pub tcpi_options: u8, + pub tcp_snd_wscale: u8, + pub tcp_rcv_wscale: u8, + pub tcpi_rto: u32, + pub __tcpi_ato: u32, + pub tcpi_snd_mss: u32, + pub tcpi_rcv_mss: u32, + pub __tcpi_unacked: u32, + pub __tcpi_sacked: u32, + pub __tcpi_lost: u32, + pub __tcpi_retrans: u32, + pub __tcpi_fackets: u32, + pub __tcpi_last_data_sent: u32, + pub __tcpi_last_ack_sent: u32, + pub tcpi_last_data_recv: u32, + pub __tcpi_last_ack_recv: u32, + pub __tcpi_pmtu: u32, + pub __tcpi_rcv_ssthresh: u32, + pub tcpi_rtt: u32, + pub tcpi_rttvar: u32, + pub tcpi_snd_ssthresh: u32, + pub tcpi_snd_cwnd: u32, + pub __tcpi_advmss: u32, + pub __tcpi_reordering: u32, + pub __tcpi_rcv_rtt: u32, + pub tcpi_rcv_space: u32, + pub tcpi_snd_wnd: u32, + pub tcpi_snd_bwnd: u32, + pub tcpi_snd_nxt: u32, + pub tcpi_rcv_nxt: u32, + pub tcpi_toe_tid: u32, + pub tcpi_snd_rexmitpack: u32, + pub tcpi_rcv_ooopack: u32, + pub tcpi_snd_zerowin: u32, + #[cfg(freebsd14)] + pub tcpi_delivered_ce: u32, + #[cfg(freebsd14)] + pub tcpi_received_ce: u32, + #[cfg(freebsd14)] + pub __tcpi_delivered_e1_bytes: u32, + #[cfg(freebsd14)] + pub __tcpi_delivered_e0_bytes: u32, + #[cfg(freebsd14)] + pub __tcpi_delivered_ce_bytes: u32, + #[cfg(freebsd14)] + pub __tcpi_received_e1_bytes: u32, + #[cfg(freebsd14)] + pub __tcpi_received_e0_bytes: u32, + #[cfg(freebsd14)] + pub __tcpi_received_ce_bytes: u32, + #[cfg(freebsd14)] + pub __tcpi_pad: [u32; 19], + #[cfg(not(freebsd14))] + pub __tcpi_pad: [u32; 26], + } + pub struct _umtx_time { pub _timeout: ::timespec, pub _flags: u32, @@ -1007,6 +1078,247 @@ s! { pub struct memory_type_list { __priv: [::uintptr_t; 2], } + + pub struct pidfh { + __priva: [[::uintptr_t; 32]; 8], + __privb: [::uintptr_t; 2], + } + + pub struct sctp_event { + pub se_assoc_id: ::sctp_assoc_t, + pub se_type: u16, + pub se_on: u8, + } + + pub struct sctp_event_subscribe { + pub sctp_data_io_event: u8, + pub sctp_association_event: u8, + pub sctp_address_event: u8, + pub sctp_send_failure_event: u8, + pub sctp_peer_error_event: u8, + pub sctp_shutdown_event: u8, + pub sctp_partial_delivery_event: u8, + pub sctp_adaptation_layer_event: u8, + pub sctp_authentication_event: u8, + pub sctp_sender_dry_event: u8, + pub sctp_stream_reset_event: u8, + } + + pub struct sctp_initmsg { + pub sinit_num_ostreams: u16, + pub sinit_max_instreams: u16, + pub sinit_max_attempts: u16, + pub sinit_max_init_timeo: u16, + } + + pub struct sctp_sndrcvinfo { + pub sinfo_stream: u16, + pub sinfo_ssn: u16, + pub sinfo_flags: u16, + pub sinfo_ppid: u32, + pub sinfo_context: u32, + pub sinfo_timetolive: u32, + pub sinfo_tsn: u32, + pub sinfo_cumtsn: u32, + pub sinfo_assoc_id: ::sctp_assoc_t, + pub sinfo_keynumber: u16, + pub sinfo_keynumber_valid: u16, + pub __reserve_pad: [[u8; 23]; 4], + } + + pub struct sctp_extrcvinfo { + pub sinfo_stream: u16, + pub sinfo_ssn: u16, + pub sinfo_flags: u16, + pub sinfo_ppid: u32, + pub sinfo_context: u32, + pub sinfo_timetolive: u32, + pub sinfo_tsn: u32, + pub sinfo_cumtsn: u32, + pub sinfo_assoc_id: ::sctp_assoc_t, + pub serinfo_next_flags: u16, + pub serinfo_next_stream: u16, + pub serinfo_next_aid: u32, + pub serinfo_next_length: u32, + pub serinfo_next_ppid: u32, + pub sinfo_keynumber: u16, + pub sinfo_keynumber_valid: u16, + pub __reserve_pad: [[u8; 19]; 4], + } + + pub struct sctp_sndinfo { + pub snd_sid: u16, + pub snd_flags: u16, + pub snd_ppid: u32, + pub snd_context: u32, + pub snd_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_prinfo { + pub pr_policy: u16, + pub pr_value: u32, + } + + pub struct sctp_default_prinfo { + pub pr_policy: u16, + pub pr_value: u32, + pub pr_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_authinfo { + pub auth_keynumber: u16, + } + + pub struct sctp_rcvinfo { + pub rcv_sid: u16, + pub rcv_ssn: u16, + pub rcv_flags: u16, + pub rcv_ppid: u32, + pub rcv_tsn: u32, + pub rcv_cumtsn: u32, + pub rcv_context: u32, + pub rcv_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_nxtinfo { + pub nxt_sid: u16, + pub nxt_flags: u16, + pub nxt_ppid: u32, + pub nxt_length: u32, + pub nxt_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_recvv_rn { + pub recvv_rcvinfo: sctp_rcvinfo, + pub recvv_nxtinfo: sctp_nxtinfo, + } + + pub struct sctp_sendv_spa { + pub sendv_flags: u32, + pub sendv_sndinfo: sctp_sndinfo, + pub sendv_prinfo: sctp_prinfo, + pub sendv_authinfo: sctp_authinfo, + } + + pub struct sctp_snd_all_completes { + pub sall_stream: u16, + pub sall_flags: u16, + pub sall_ppid: u32, + pub sall_context: u32, + pub sall_num_sent: u32, + pub sall_num_failed: u32, + } + + pub struct sctp_pcbinfo { + pub ep_count: u32, + pub asoc_count: u32, + pub laddr_count: u32, + pub raddr_count: u32, + pub chk_count: u32, + pub readq_count: u32, + pub free_chunks: u32, + pub stream_oque: u32, + } + + pub struct sctp_sockstat { + pub ss_assoc_id: ::sctp_assoc_t, + pub ss_total_sndbuf: u32, + pub ss_total_recv_buf: u32, + } + + pub struct sctp_assoc_change { + pub sac_type: u16, + pub sac_flags: u16, + pub sac_length: u32, + pub sac_state: u16, + pub sac_error: u16, + pub sac_outbound_streams: u16, + pub sac_inbound_streams: u16, + pub sac_assoc_id: ::sctp_assoc_t, + pub sac_info: [u8; 0], + } + + pub struct sctp_paddr_change { + pub spc_type: u16, + pub spc_flags: u16, + pub spc_length: u32, + pub spc_aaddr: ::sockaddr_storage, + pub spc_state: u32, + pub spc_error: u32, + pub spc_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_remote_error { + pub sre_type: u16, + pub sre_flags: u16, + pub sre_length: u32, + pub sre_error: u16, + pub sre_assoc_id: ::sctp_assoc_t, + pub sre_data: [u8; 0], + } + + pub struct sctp_send_failed_event { + pub ssfe_type: u16, + pub ssfe_flags: u16, + pub ssfe_length: u32, + pub ssfe_error: u32, + pub ssfe_info: sctp_sndinfo, + pub ssfe_assoc_id: ::sctp_assoc_t, + pub ssfe_data: [u8; 0], + } + + pub struct sctp_shutdown_event { + pub sse_type: u16, + pub sse_flags: u16, + pub sse_length: u32, + pub sse_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_adaptation_event { + pub sai_type: u16, + pub sai_flags: u16, + pub sai_length: u32, + pub sai_adaptation_ind: u32, + pub sai_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_setadaptation { + pub ssb_adaptation_ind: u32, + } + + pub struct sctp_pdapi_event { + pub pdapi_type: u16, + pub pdapi_flags: u16, + pub pdapi_length: u32, + pub pdapi_indication: u32, + pub pdapi_stream: u16, + pub pdapi_seq: u16, + pub pdapi_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_sender_dry_event { + pub sender_dry_type: u16, + pub sender_dry_flags: u16, + pub sender_dry_length: u32, + pub sender_dry_assoc_id: ::sctp_assoc_t, + } + + pub struct sctp_stream_reset_event { + pub strreset_type: u16, + pub strreset_flags: u16, + pub strreset_length: u32, + pub strreset_assoc_id: ::sctp_assoc_t, + pub strreset_stream_list: [u16; 0], + } + + pub struct sctp_stream_change_event { + pub strchange_type: u16, + pub strchange_flags: u16, + pub strchange_length: u32, + pub strchange_assoc_id: ::sctp_assoc_t, + pub strchange_instrms: u16, + pub strchange_outstrms: u16, + } } s_no_extra_traits! { @@ -1217,6 +1529,88 @@ s_no_extra_traits! { pub ifdr_vendor: u32, pub ifdr_msg: [::c_char; ::IFDR_MSG_SIZE as usize], } + + #[repr(packed)] + pub struct sctphdr { + pub src_port: u16, + pub dest_port: u16, + pub v_tag: u32, + pub checksum: u32, + } + + #[repr(packed)] + pub struct sctp_chunkhdr { + pub chunk_type: u8, + pub chunk_flags: u8, + pub chunk_length: u16, + } + + #[repr(packed)] + pub struct sctp_paramhdr { + pub param_type: u16, + pub param_length: u16, + } + + #[repr(packed)] + pub struct sctp_gen_error_cause { + pub code: u16, + pub length: u16, + pub info: [u8; 0], + } + + #[repr(packed)] + pub struct sctp_error_cause { + pub code: u16, + pub length: u16, + } + + #[repr(packed)] + pub struct sctp_error_invalid_stream { + pub cause: sctp_error_cause, + pub stream_id: u16, + __reserved: u16, + } + + #[repr(packed)] + pub struct sctp_error_missing_param { + pub cause: sctp_error_cause, + pub num_missing_params: u32, + pub tpe: [u8; 0], + } + + #[repr(packed)] + pub struct sctp_error_stale_cookie { + pub cause: sctp_error_cause, + pub stale_time: u32, + } + + #[repr(packed)] + pub struct sctp_error_out_of_resource { + pub cause: sctp_error_cause, + } + + #[repr(packed)] + pub struct sctp_error_unresolv_addr { + pub cause: sctp_error_cause, + } + + #[repr(packed)] + pub struct sctp_error_unrecognized_chunk { + pub cause: sctp_error_cause, + pub ch: sctp_chunkhdr, + } + + #[repr(packed)] + pub struct sctp_error_no_user_data { + pub cause: sctp_error_cause, + pub tsn: u32, + } + + #[repr(packed)] + pub struct sctp_error_auth_invalid_hmac { + pub cause: sctp_error_cause, + pub hmac_id: u16, + } } cfg_if! { @@ -1878,6 +2272,301 @@ cfg_if! { self.__ifi_lastchange.hash(state); } } + + impl PartialEq for sctphdr { + fn eq(&self, other: &sctphdr) -> bool { + return {self.src_port} == {other.src_port} && + {self.dest_port} == {other.dest_port} && + {self.v_tag} == {other.v_tag} && + {self.checksum} == {other.checksum} + } + } + impl Eq for sctphdr {} + impl ::fmt::Debug for sctphdr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctphdr") + .field("src_port", &{self.src_port}) + .field("dest_port", &{self.dest_port}) + .field("v_tag", &{self.v_tag}) + .field("checksum", &{self.checksum}) + .finish() + } + } + impl ::hash::Hash for sctphdr { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.src_port}.hash(state); + {self.dest_port}.hash(state); + {self.v_tag}.hash(state); + {self.checksum}.hash(state); + } + } + + impl PartialEq for sctp_chunkhdr { + fn eq(&self, other: &sctp_chunkhdr) -> bool { + return {self.chunk_type} == {other.chunk_type} && + {self.chunk_flags} == {other.chunk_flags} && + {self.chunk_length} == {other.chunk_length} + } + } + impl Eq for sctp_chunkhdr {} + impl ::fmt::Debug for sctp_chunkhdr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_chunkhdr") + .field("chunk_type", &{self.chunk_type}) + .field("chunk_flags", &{self.chunk_flags}) + .field("chunk_length", &{self.chunk_length}) + .finish() + } + } + impl ::hash::Hash for sctp_chunkhdr { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.chunk_type}.hash(state); + {self.chunk_flags}.hash(state); + {self.chunk_length}.hash(state); + } + } + + impl PartialEq for sctp_paramhdr { + fn eq(&self, other: &sctp_paramhdr) -> bool { + return {self.param_type} == {other.param_type} && + {self.param_length} == {other.param_length} + } + } + impl Eq for sctp_paramhdr {} + impl ::fmt::Debug for sctp_paramhdr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_paramhdr") + .field("param_type", &{self.param_type}) + .field("param_length", &{self.param_length}) + .finish() + } + } + impl ::hash::Hash for sctp_paramhdr { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.param_type}.hash(state); + {self.param_length}.hash(state); + } + } + + impl PartialEq for sctp_gen_error_cause { + fn eq(&self, other: &sctp_gen_error_cause) -> bool { + return {self.code} == {other.code} && + {self.length} == {other.length} && + {self.info}.iter().zip({other.info}.iter()).all(|(a,b)| a == b) + } + } + impl Eq for sctp_gen_error_cause {} + impl ::fmt::Debug for sctp_gen_error_cause { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_gen_error_cause") + .field("code", &{self.code}) + .field("length", &{self.length}) + // FIXME: .field("info", &{self.info}) + .finish() + } + } + impl ::hash::Hash for sctp_gen_error_cause { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.code}.hash(state); + {self.length}.hash(state); + {self.info}.hash(state); + } + } + + impl PartialEq for sctp_error_cause { + fn eq(&self, other: &sctp_error_cause) -> bool { + return {self.code} == {other.code} && + {self.length} == {other.length} + } + } + impl Eq for sctp_error_cause {} + impl ::fmt::Debug for sctp_error_cause { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_error_cause") + .field("code", &{self.code}) + .field("length", &{self.length}) + .finish() + } + } + impl ::hash::Hash for sctp_error_cause { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.code}.hash(state); + {self.length}.hash(state); + } + } + + impl PartialEq for sctp_error_invalid_stream { + fn eq(&self, other: &sctp_error_invalid_stream) -> bool { + return {self.cause} == {other.cause} && + {self.stream_id} == {other.stream_id} + } + } + impl Eq for sctp_error_invalid_stream {} + impl ::fmt::Debug for sctp_error_invalid_stream { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_error_invalid_stream") + .field("cause", &{self.cause}) + .field("stream_id", &{self.stream_id}) + .finish() + } + } + impl ::hash::Hash for sctp_error_invalid_stream { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.cause}.hash(state); + {self.stream_id}.hash(state); + } + } + + impl PartialEq for sctp_error_missing_param { + fn eq(&self, other: &sctp_error_missing_param) -> bool { + return {self.cause} == {other.cause} && + {self.num_missing_params} == {other.num_missing_params} && + {self.tpe}.iter().zip({other.tpe}.iter()).all(|(a,b)| a == b) + } + } + impl Eq for sctp_error_missing_param {} + impl ::fmt::Debug for sctp_error_missing_param { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_error_missing_param") + .field("cause", &{self.cause}) + .field("num_missing_params", &{self.num_missing_params}) + // FIXME: .field("tpe", &{self.tpe}) + .finish() + } + } + impl ::hash::Hash for sctp_error_missing_param { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.cause}.hash(state); + {self.num_missing_params}.hash(state); + {self.tpe}.hash(state); + } + } + + impl PartialEq for sctp_error_stale_cookie { + fn eq(&self, other: &sctp_error_stale_cookie) -> bool { + return {self.cause} == {other.cause} && + {self.stale_time} == {other.stale_time} + } + } + impl Eq for sctp_error_stale_cookie {} + impl ::fmt::Debug for sctp_error_stale_cookie { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_error_stale_cookie") + .field("cause", &{self.cause}) + .field("stale_time", &{self.stale_time}) + .finish() + } + } + impl ::hash::Hash for sctp_error_stale_cookie { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.cause}.hash(state); + {self.stale_time}.hash(state); + } + } + + impl PartialEq for sctp_error_out_of_resource { + fn eq(&self, other: &sctp_error_out_of_resource) -> bool { + return {self.cause} == {other.cause} + } + } + impl Eq for sctp_error_out_of_resource {} + impl ::fmt::Debug for sctp_error_out_of_resource { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_error_out_of_resource") + .field("cause", &{self.cause}) + .finish() + } + } + impl ::hash::Hash for sctp_error_out_of_resource { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.cause}.hash(state); + } + } + + impl PartialEq for sctp_error_unresolv_addr { + fn eq(&self, other: &sctp_error_unresolv_addr) -> bool { + return {self.cause} == {other.cause} + } + } + impl Eq for sctp_error_unresolv_addr {} + impl ::fmt::Debug for sctp_error_unresolv_addr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_error_unresolv_addr") + .field("cause", &{self.cause}) + .finish() + } + } + impl ::hash::Hash for sctp_error_unresolv_addr { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.cause}.hash(state); + } + } + + impl PartialEq for sctp_error_unrecognized_chunk { + fn eq(&self, other: &sctp_error_unrecognized_chunk) -> bool { + return {self.cause} == {other.cause} && + {self.ch} == {other.ch} + } + } + impl Eq for sctp_error_unrecognized_chunk {} + impl ::fmt::Debug for sctp_error_unrecognized_chunk { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_error_unrecognized_chunk") + .field("cause", &{self.cause}) + .field("ch", &{self.ch}) + .finish() + } + } + impl ::hash::Hash for sctp_error_unrecognized_chunk { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.cause}.hash(state); + {self.ch}.hash(state); + } + } + + impl PartialEq for sctp_error_no_user_data { + fn eq(&self, other: &sctp_error_no_user_data) -> bool { + return {self.cause} == {other.cause} && + {self.tsn} == {other.tsn} + } + } + impl Eq for sctp_error_no_user_data {} + impl ::fmt::Debug for sctp_error_no_user_data { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_error_no_user_data") + .field("cause", &{self.cause}) + .field("tsn", &{self.tsn}) + .finish() + } + } + impl ::hash::Hash for sctp_error_no_user_data { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.cause}.hash(state); + {self.tsn}.hash(state); + } + } + + impl PartialEq for sctp_error_auth_invalid_hmac { + fn eq(&self, other: &sctp_error_auth_invalid_hmac) -> bool { + return {self.cause} == {other.cause} && + {self.hmac_id} == {other.hmac_id} + } + } + impl Eq for sctp_error_auth_invalid_hmac {} + impl ::fmt::Debug for sctp_error_auth_invalid_hmac { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sctp_error_invalid_hmac") + .field("cause", &{self.cause}) + .field("hmac_id", &{self.hmac_id}) + .finish() + } + } + impl ::hash::Hash for sctp_error_auth_invalid_hmac { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + {self.cause}.hash(state); + {self.hmac_id}.hash(state); + } + } } } @@ -1928,8 +2617,14 @@ pub const SF_USER_READAHEAD: ::c_int = 0x00000008; pub const SF_NOCACHE: ::c_int = 0x00000010; pub const O_CLOEXEC: ::c_int = 0x00100000; pub const O_DIRECTORY: ::c_int = 0x00020000; +pub const O_DSYNC: ::c_int = 0x01000000; +pub const O_EMPTY_PATH: ::c_int = 0x02000000; pub const O_EXEC: ::c_int = 0x00040000; +pub const O_PATH: ::c_int = 0x00400000; +pub const O_RESOLVE_BENEATH: ::c_int = 0x00800000; +pub const O_SEARCH: ::c_int = O_EXEC; pub const O_TTY_INIT: ::c_int = 0x00080000; +pub const O_VERIFY: ::c_int = 0x00200000; pub const F_GETLK: ::c_int = 11; pub const F_SETLK: ::c_int = 12; pub const F_SETLKW: ::c_int = 13; @@ -2306,9 +3001,17 @@ pub const SO_SETFIB: ::c_int = 0x1014; pub const SO_USER_COOKIE: ::c_int = 0x1015; pub const SO_PROTOCOL: ::c_int = 0x1016; pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL; +pub const SO_TS_CLOCK: ::c_int = 0x1017; pub const SO_DOMAIN: ::c_int = 0x1019; pub const SO_VENDOR: ::c_int = 0x80000000; +pub const SO_TS_REALTIME_MICRO: ::c_int = 0; +pub const SO_TS_BINTIME: ::c_int = 1; +pub const SO_TS_REALTIME: ::c_int = 2; +pub const SO_TS_MONOTONIC: ::c_int = 3; +pub const SO_TS_DEFAULT: ::c_int = SO_TS_REALTIME_MICRO; +pub const SO_TS_CLOCK_MAX: ::c_int = SO_TS_MONOTONIC; + pub const LOCAL_CREDS: ::c_int = 2; pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3; pub const LOCAL_CONNWAIT: ::c_int = 4; @@ -2356,6 +3059,7 @@ pub const PT_VM_TIMESTAMP: ::c_int = 40; pub const PT_VM_ENTRY: ::c_int = 41; pub const PT_GETREGSET: ::c_int = 42; pub const PT_SETREGSET: ::c_int = 43; +pub const PT_SC_REMOTE: ::c_int = 44; pub const PT_FIRSTMACH: ::c_int = 64; pub const PTRACE_EXEC: ::c_int = 0x0001; @@ -3033,6 +3737,8 @@ pub const AT_EACCESS: ::c_int = 0x100; pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200; pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; pub const AT_REMOVEDIR: ::c_int = 0x800; +pub const AT_RESOLVE_BENEATH: ::c_int = 0x2000; +pub const AT_EMPTY_PATH: ::c_int = 0x4000; pub const AT_NULL: ::c_int = 0; pub const AT_IGNORE: ::c_int = 1; @@ -3792,6 +4498,167 @@ pub const CPU_WHICH_CPUSET: ::c_int = 3; pub const CPU_WHICH_IRQ: ::c_int = 4; pub const CPU_WHICH_JAIL: ::c_int = 5; +// sys/signal.h +pub const SIGTHR: ::c_int = 32; +pub const SIGLWP: ::c_int = SIGTHR; +pub const SIGLIBRT: ::c_int = 33; + +// netinet/sctp.h +pub const SCTP_FUTURE_ASSOC: ::c_int = 0; +pub const SCTP_CURRENT_ASSOC: ::c_int = 1; +pub const SCTP_ALL_ASSOC: ::c_int = 2; + +pub const SCTP_NO_NEXT_MSG: ::c_int = 0x0000; +pub const SCTP_NEXT_MSG_AVAIL: ::c_int = 0x0001; +pub const SCTP_NEXT_MSG_ISCOMPLETE: ::c_int = 0x0002; +pub const SCTP_NEXT_MSG_IS_UNORDERED: ::c_int = 0x0004; +pub const SCTP_NEXT_MSG_IS_NOTIFICATION: ::c_int = 0x0008; + +pub const SCTP_RECVV_NOINFO: ::c_int = 0; +pub const SCTP_RECVV_RCVINFO: ::c_int = 1; +pub const SCTP_RECVV_NXTINFO: ::c_int = 2; +pub const SCTP_RECVV_RN: ::c_int = 3; + +pub const SCTP_SENDV_NOINFO: ::c_int = 0; +pub const SCTP_SENDV_SNDINFO: ::c_int = 1; +pub const SCTP_SENDV_PRINFO: ::c_int = 2; +pub const SCTP_SENDV_AUTHINFO: ::c_int = 3; +pub const SCTP_SENDV_SPA: ::c_int = 4; + +pub const SCTP_SEND_SNDINFO_VALID: ::c_int = 0x00000001; +pub const SCTP_SEND_PRINFO_VALID: ::c_int = 0x00000002; +pub const SCTP_SEND_AUTHINFO_VALID: ::c_int = 0x00000004; + +pub const SCTP_NOTIFICATION: ::c_int = 0x0010; +pub const SCTP_COMPLETE: ::c_int = 0x0020; +pub const SCTP_EOF: ::c_int = 0x0100; +pub const SCTP_ABORT: ::c_int = 0x0200; +pub const SCTP_UNORDERED: ::c_int = 0x0400; +pub const SCTP_ADDR_OVER: ::c_int = 0x0800; +pub const SCTP_SENDALL: ::c_int = 0x1000; +pub const SCTP_EOR: ::c_int = 0x2000; +pub const SCTP_SACK_IMMEDIATELY: ::c_int = 0x4000; +pub const SCTP_PR_SCTP_NONE: ::c_int = 0x0000; +pub const SCTP_PR_SCTP_TTL: ::c_int = 0x0001; +pub const SCTP_PR_SCTP_PRIO: ::c_int = 0x0002; +pub const SCTP_PR_SCTP_BUF: ::c_int = SCTP_PR_SCTP_PRIO; +pub const SCTP_PR_SCTP_RTX: ::c_int = 0x0003; +pub const SCTP_PR_SCTP_MAX: ::c_int = SCTP_PR_SCTP_RTX; +pub const SCTP_PR_SCTP_ALL: ::c_int = 0x000f; + +pub const SCTP_INIT: ::c_int = 0x0001; +pub const SCTP_SNDRCV: ::c_int = 0x0002; +pub const SCTP_EXTRCV: ::c_int = 0x0003; +pub const SCTP_SNDINFO: ::c_int = 0x0004; +pub const SCTP_RCVINFO: ::c_int = 0x0005; +pub const SCTP_NXTINFO: ::c_int = 0x0006; +pub const SCTP_PRINFO: ::c_int = 0x0007; +pub const SCTP_AUTHINFO: ::c_int = 0x0008; +pub const SCTP_DSTADDRV4: ::c_int = 0x0009; +pub const SCTP_DSTADDRV6: ::c_int = 0x000a; + +pub const SCTP_RTOINFO: ::c_int = 0x00000001; +pub const SCTP_ASSOCINFO: ::c_int = 0x00000002; +pub const SCTP_INITMSG: ::c_int = 0x00000003; +pub const SCTP_NODELAY: ::c_int = 0x00000004; +pub const SCTP_AUTOCLOSE: ::c_int = 0x00000005; +pub const SCTP_SET_PEER_PRIMARY_ADDR: ::c_int = 0x00000006; +pub const SCTP_PRIMARY_ADDR: ::c_int = 0x00000007; +pub const SCTP_ADAPTATION_LAYER: ::c_int = 0x00000008; +pub const SCTP_ADAPTION_LAYER: ::c_int = 0x00000008; +pub const SCTP_DISABLE_FRAGMENTS: ::c_int = 0x00000009; +pub const SCTP_PEER_ADDR_PARAMS: ::c_int = 0x0000000a; +pub const SCTP_DEFAULT_SEND_PARAM: ::c_int = 0x0000000b; +pub const SCTP_EVENTS: ::c_int = 0x0000000c; +pub const SCTP_I_WANT_MAPPED_V4_ADDR: ::c_int = 0x0000000d; +pub const SCTP_MAXSEG: ::c_int = 0x0000000e; +pub const SCTP_DELAYED_SACK: ::c_int = 0x0000000f; +pub const SCTP_FRAGMENT_INTERLEAVE: ::c_int = 0x00000010; +pub const SCTP_PARTIAL_DELIVERY_POINT: ::c_int = 0x00000011; +pub const SCTP_AUTH_CHUNK: ::c_int = 0x00000012; +pub const SCTP_AUTH_KEY: ::c_int = 0x00000013; +pub const SCTP_HMAC_IDENT: ::c_int = 0x00000014; +pub const SCTP_AUTH_ACTIVE_KEY: ::c_int = 0x00000015; +pub const SCTP_AUTH_DELETE_KEY: ::c_int = 0x00000016; +pub const SCTP_USE_EXT_RCVINFO: ::c_int = 0x00000017; +pub const SCTP_AUTO_ASCONF: ::c_int = 0x00000018; +pub const SCTP_MAXBURST: ::c_int = 0x00000019; +pub const SCTP_MAX_BURST: ::c_int = 0x00000019; +pub const SCTP_CONTEXT: ::c_int = 0x0000001a; +pub const SCTP_EXPLICIT_EOR: ::c_int = 0x00000001b; +pub const SCTP_REUSE_PORT: ::c_int = 0x00000001c; +pub const SCTP_AUTH_DEACTIVATE_KEY: ::c_int = 0x00000001d; +pub const SCTP_EVENT: ::c_int = 0x0000001e; +pub const SCTP_RECVRCVINFO: ::c_int = 0x0000001f; +pub const SCTP_RECVNXTINFO: ::c_int = 0x00000020; +pub const SCTP_DEFAULT_SNDINFO: ::c_int = 0x00000021; +pub const SCTP_DEFAULT_PRINFO: ::c_int = 0x00000022; +pub const SCTP_PEER_ADDR_THLDS: ::c_int = 0x00000023; +pub const SCTP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 0x00000024; +pub const SCTP_ECN_SUPPORTED: ::c_int = 0x00000025; +pub const SCTP_AUTH_SUPPORTED: ::c_int = 0x00000027; +pub const SCTP_ASCONF_SUPPORTED: ::c_int = 0x00000028; +pub const SCTP_RECONFIG_SUPPORTED: ::c_int = 0x00000029; +pub const SCTP_NRSACK_SUPPORTED: ::c_int = 0x00000030; +pub const SCTP_PKTDROP_SUPPORTED: ::c_int = 0x00000031; +pub const SCTP_MAX_CWND: ::c_int = 0x00000032; + +pub const SCTP_STATUS: ::c_int = 0x00000100; +pub const SCTP_GET_PEER_ADDR_INFO: ::c_int = 0x00000101; +pub const SCTP_PEER_AUTH_CHUNKS: ::c_int = 0x00000102; +pub const SCTP_LOCAL_AUTH_CHUNKS: ::c_int = 0x00000103; +pub const SCTP_GET_ASSOC_NUMBER: ::c_int = 0x00000104; +pub const SCTP_GET_ASSOC_ID_LIST: ::c_int = 0x00000105; +pub const SCTP_TIMEOUTS: ::c_int = 0x00000106; +pub const SCTP_PR_STREAM_STATUS: ::c_int = 0x00000107; +pub const SCTP_PR_ASSOC_STATUS: ::c_int = 0x00000108; + +pub const SCTP_COMM_UP: ::c_int = 0x0001; +pub const SCTP_COMM_LOST: ::c_int = 0x0002; +pub const SCTP_RESTART: ::c_int = 0x0003; +pub const SCTP_SHUTDOWN_COMP: ::c_int = 0x0004; +pub const SCTP_CANT_STR_ASSOC: ::c_int = 0x0005; + +pub const SCTP_ASSOC_SUPPORTS_PR: ::c_int = 0x01; +pub const SCTP_ASSOC_SUPPORTS_AUTH: ::c_int = 0x02; +pub const SCTP_ASSOC_SUPPORTS_ASCONF: ::c_int = 0x03; +pub const SCTP_ASSOC_SUPPORTS_MULTIBUF: ::c_int = 0x04; +pub const SCTP_ASSOC_SUPPORTS_RE_CONFIG: ::c_int = 0x05; +pub const SCTP_ASSOC_SUPPORTS_INTERLEAVING: ::c_int = 0x06; +pub const SCTP_ASSOC_SUPPORTS_MAX: ::c_int = 0x06; + +pub const SCTP_ADDR_AVAILABLE: ::c_int = 0x0001; +pub const SCTP_ADDR_UNREACHABLE: ::c_int = 0x0002; +pub const SCTP_ADDR_REMOVED: ::c_int = 0x0003; +pub const SCTP_ADDR_ADDED: ::c_int = 0x0004; +pub const SCTP_ADDR_MADE_PRIM: ::c_int = 0x0005; +pub const SCTP_ADDR_CONFIRMED: ::c_int = 0x0006; + +pub const SCTP_ACTIVE: ::c_int = 0x0001; +pub const SCTP_INACTIVE: ::c_int = 0x0002; +pub const SCTP_UNCONFIRMED: ::c_int = 0x0200; + +pub const SCTP_DATA_UNSENT: ::c_int = 0x0001; +pub const SCTP_DATA_SENT: ::c_int = 0x0002; + +pub const SCTP_PARTIAL_DELIVERY_ABORTED: ::c_int = 0x0001; + +pub const SCTP_AUTH_NEW_KEY: ::c_int = 0x0001; +pub const SCTP_AUTH_NEWKEY: ::c_int = SCTP_AUTH_NEW_KEY; +pub const SCTP_AUTH_NO_AUTH: ::c_int = 0x0002; +pub const SCTP_AUTH_FREE_KEY: ::c_int = 0x0003; + +pub const SCTP_STREAM_RESET_INCOMING_SSN: ::c_int = 0x0001; +pub const SCTP_STREAM_RESET_OUTGOING_SSN: ::c_int = 0x0002; +pub const SCTP_STREAM_RESET_DENIED: ::c_int = 0x0004; +pub const SCTP_STREAM_RESET_FAILED: ::c_int = 0x0008; + +pub const SCTP_ASSOC_RESET_DENIED: ::c_int = 0x0004; +pub const SCTP_ASSOC_RESET_FAILED: ::c_int = 0x0008; + +pub const SCTP_STREAM_CHANGE_DENIED: ::c_int = 0x0004; +pub const SCTP_STREAM_CHANGE_FAILED: ::c_int = 0x0008; + const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES @@ -3913,6 +4780,39 @@ safe_f! { pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { (status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13 } + + pub {const} fn INVALID_SINFO_FLAG(x: ::c_int) -> bool { + (x) & 0xfffffff0 & !(SCTP_EOF | SCTP_ABORT | SCTP_UNORDERED | + SCTP_ADDR_OVER | SCTP_SENDALL | SCTP_EOR | SCTP_SACK_IMMEDIATELY) != 0 + } + + pub {const} fn PR_SCTP_POLICY(x: ::c_int) -> ::c_int { + x & 0x0f + } + + pub {const} fn PR_SCTP_ENABLED(x: ::c_int) -> bool { + PR_SCTP_POLICY(x) != SCTP_PR_SCTP_NONE && PR_SCTP_POLICY(x) != SCTP_PR_SCTP_ALL + } + + pub {const} fn PR_SCTP_TTL_ENABLED(x: ::c_int) -> bool { + PR_SCTP_POLICY(x) == SCTP_PR_SCTP_TTL + } + + pub {const} fn PR_SCTP_BUF_ENABLED(x: ::c_int) -> bool { + PR_SCTP_POLICY(x) == SCTP_PR_SCTP_BUF + } + + pub {const} fn PR_SCTP_RTX_ENABLED(x: ::c_int) -> bool { + PR_SCTP_POLICY(x) == SCTP_PR_SCTP_RTX + } + + pub {const} fn PR_SCTP_INVALID_POLICY(x: ::c_int) -> bool { + PR_SCTP_POLICY(x) > SCTP_PR_SCTP_MAX + } + + pub {const} fn PR_SCTP_VALID_POLICY(x: ::c_int) -> bool { + PR_SCTP_POLICY(x) <= SCTP_PR_SCTP_MAX + } } cfg_if! { @@ -4368,6 +5268,14 @@ extern "C" { pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int; pub fn clock_getcpuclockid2(arg1: ::id_t, arg2: ::c_int, arg3: *mut clockid_t) -> ::c_int; + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + + pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char; pub fn shm_create_largepage( path: *const ::c_char, @@ -4384,6 +5292,17 @@ extern "C" { pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int; pub fn setaudit(auditinfo: *const auditinfo_t) -> ::c_int; + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + + pub fn fdatasync(fd: ::c_int) -> ::c_int; + + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; + pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; + pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int; + pub fn setproctitle_fast(fmt: *const ::c_char, ...); + pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn _umtx_op( obj: *mut ::c_void, op: ::c_int, @@ -4391,6 +5310,57 @@ extern "C" { uaddr: *mut ::c_void, uaddr2: *mut ::c_void, ) -> ::c_int; + + pub fn sctp_peeloff(s: ::c_int, id: ::sctp_assoc_t) -> ::c_int; + pub fn sctp_bindx(s: ::c_int, addrs: *mut ::sockaddr, num: ::c_int, tpe: ::c_int) -> ::c_int; + pub fn sctp_connectx( + s: ::c_int, + addrs: *const ::sockaddr, + addrcnt: ::c_int, + id: *mut ::sctp_assoc_t, + ) -> ::c_int; + pub fn sctp_getaddrlen(family: ::sa_family_t) -> ::c_int; + pub fn sctp_getpaddrs( + s: ::c_int, + asocid: ::sctp_assoc_t, + addrs: *mut *mut ::sockaddr, + ) -> ::c_int; + pub fn sctp_freepaddrs(addrs: *mut ::sockaddr); + pub fn sctp_getladdrs( + s: ::c_int, + asocid: ::sctp_assoc_t, + addrs: *mut *mut ::sockaddr, + ) -> ::c_int; + pub fn sctp_freeladdrs(addrs: *mut ::sockaddr); + pub fn sctp_opt_info( + s: ::c_int, + id: ::sctp_assoc_t, + opt: ::c_int, + arg: *mut ::c_void, + size: *mut ::socklen_t, + ) -> ::c_int; + pub fn sctp_sendv( + sd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + addrs: *mut ::sockaddr, + addrcnt: ::c_int, + info: *mut ::c_void, + infolen: ::socklen_t, + infotype: ::c_uint, + flags: ::c_int, + ) -> ::ssize_t; + pub fn sctp_recvv( + sd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + from: *mut ::sockaddr, + fromlen: *mut ::socklen_t, + info: *mut ::c_void, + infolen: *mut ::socklen_t, + infotype: *mut ::c_uint, + flags: *mut ::c_int, + ) -> ::ssize_t; } #[link(name = "memstat")] @@ -4483,6 +5453,17 @@ extern "C" { pub fn flopenat(fd: ::c_int, path: *const ::c_char, flags: ::c_int, ...) -> ::c_int; pub fn getlocalbase() -> *const ::c_char; + + pub fn pidfile_open( + path: *const ::c_char, + mode: ::mode_t, + pidptr: *mut ::pid_t, + ) -> *mut ::pidfh; + pub fn pidfile_write(path: *mut ::pidfh) -> ::c_int; + pub fn pidfile_close(path: *mut ::pidfh) -> ::c_int; + pub fn pidfile_remove(path: *mut ::pidfh) -> ::c_int; + pub fn pidfile_fileno(path: *const ::pidfh) -> ::c_int; + // FIXME: pidfile_signal in due time (both manpage present and updated image snapshot) } #[link(name = "procstat")] diff --git a/vendor/libc/src/unix/bsd/freebsdlike/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/mod.rs index 9aefb36e4..6a0f383bc 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/mod.rs @@ -824,12 +824,15 @@ pub const CLOCK_VIRTUAL: ::clockid_t = 1; pub const CLOCK_PROF: ::clockid_t = 2; pub const CLOCK_MONOTONIC: ::clockid_t = 4; pub const CLOCK_UPTIME: ::clockid_t = 5; +pub const CLOCK_BOOTTIME: ::clockid_t = CLOCK_UPTIME; pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7; pub const CLOCK_UPTIME_FAST: ::clockid_t = 8; pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9; pub const CLOCK_REALTIME_FAST: ::clockid_t = 10; +pub const CLOCK_REALTIME_COARSE: ::clockid_t = CLOCK_REALTIME_FAST; pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11; pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12; +pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = CLOCK_MONOTONIC_FAST; pub const CLOCK_SECOND: ::clockid_t = 13; pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14; pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15; |