diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/libc/src | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/libc/src')
29 files changed, 956 insertions, 226 deletions
diff --git a/vendor/libc/src/unix/bsd/apple/mod.rs b/vendor/libc/src/unix/bsd/apple/mod.rs index 4b6ce9b4c..c6f254ea5 100644 --- a/vendor/libc/src/unix/bsd/apple/mod.rs +++ b/vendor/libc/src/unix/bsd/apple/mod.rs @@ -1381,6 +1381,15 @@ s_no_extra_traits! { pub struct os_unfair_lock_s { _os_unfair_lock_opaque: u32, } + + #[cfg_attr(libc_packedN, repr(packed(1)))] + pub struct sockaddr_vm { + pub svm_len: ::c_uchar, + pub svm_family: ::sa_family_t, + pub svm_reserved1: ::c_ushort, + pub svm_port: ::c_uint, + pub svm_cid: ::c_uint, + } } impl siginfo_t { @@ -2683,6 +2692,52 @@ cfg_if! { self._os_unfair_lock_opaque.hash(state); } } + + impl PartialEq for sockaddr_vm { + fn eq(&self, other: &sockaddr_vm) -> bool { + self.svm_len == other.svm_len + && self.svm_family == other.svm_family + && self.svm_reserved1 == other.svm_reserved1 + && self.svm_port == other.svm_port + && self.svm_cid == other.svm_cid + } + } + + impl Eq for sockaddr_vm {} + + impl ::fmt::Debug for sockaddr_vm { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let svm_len = self.svm_len; + let svm_family = self.svm_family; + let svm_reserved1 = self.svm_reserved1; + let svm_port = self.svm_port; + let svm_cid = self.svm_cid; + + f.debug_struct("sockaddr_vm") + .field("svm_len",&svm_len) + .field("svm_family",&svm_family) + .field("svm_reserved1",&svm_reserved1) + .field("svm_port",&svm_port) + .field("svm_cid",&svm_cid) + .finish() + } + } + + impl ::hash::Hash for sockaddr_vm { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + let svm_len = self.svm_len; + let svm_family = self.svm_family; + let svm_reserved1 = self.svm_reserved1; + let svm_port = self.svm_port; + let svm_cid = self.svm_cid; + + svm_len.hash(state); + svm_family.hash(state); + svm_reserved1.hash(state); + svm_port.hash(state); + svm_cid.hash(state); + } + } } } @@ -3644,6 +3699,9 @@ pub const AF_SYSTEM: ::c_int = 32; pub const AF_NETBIOS: ::c_int = 33; pub const AF_PPP: ::c_int = 34; pub const pseudo_AF_HDRCMPLT: ::c_int = 35; +pub const AF_IEEE80211: ::c_int = 37; +pub const AF_UTUN: ::c_int = 38; +pub const AF_VSOCK: ::c_int = 40; pub const AF_SYS_CONTROL: ::c_int = 2; pub const SYSPROTO_EVENT: ::c_int = 1; @@ -3685,6 +3743,7 @@ pub const PF_NATM: ::c_int = AF_NATM; pub const PF_SYSTEM: ::c_int = AF_SYSTEM; pub const PF_NETBIOS: ::c_int = AF_NETBIOS; pub const PF_PPP: ::c_int = AF_PPP; +pub const PF_VSOCK: ::c_int = AF_VSOCK; pub const NET_RT_DUMP: ::c_int = 1; pub const NET_RT_FLAGS: ::c_int = 2; @@ -3792,12 +3851,13 @@ pub const MSG_HOLD: ::c_int = 0x800; pub const MSG_SEND: ::c_int = 0x1000; pub const MSG_HAVEMORE: ::c_int = 0x2000; pub const MSG_RCVMORE: ::c_int = 0x4000; -// pub const MSG_COMPAT: ::c_int = 0x8000; +pub const MSG_NEEDSA: ::c_int = 0x10000; +pub const MSG_NOSIGNAL: ::c_int = 0x80000; pub const SCM_TIMESTAMP: ::c_int = 0x02; pub const SCM_CREDS: ::c_int = 0x03; -// https://github.com/aosm/xnu/blob/master/bsd/net/if.h#L140-L156 +// https://github.com/aosm/xnu/blob/HEAD/bsd/net/if.h#L140-L156 pub const IFF_UP: ::c_int = 0x1; // interface is up pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging @@ -4594,7 +4654,7 @@ pub const DLT_ATM_RFC1483: ::c_uint = 11; // LLC/SNAP encapsulated atm pub const DLT_RAW: ::c_uint = 12; // raw IP pub const DLT_LOOP: ::c_uint = 108; -// https://github.com/apple/darwin-xnu/blob/master/bsd/net/bpf.h#L100 +// https://github.com/apple/darwin-xnu/blob/HEAD/bsd/net/bpf.h#L100 // sizeof(i32) pub const BPF_ALIGNMENT: ::c_int = 4; @@ -5002,6 +5062,13 @@ pub const SSTOP: u32 = 4; /// Awaiting collection by parent. pub const SZOMB: u32 = 5; +// sys/vsock.h +pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF; +pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0; +pub const VMADDR_CID_RESERVED: ::c_uint = 1; +pub const VMADDR_CID_HOST: ::c_uint = 2; +pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF; + cfg_if! { if #[cfg(libc_const_extern_fn)] { const fn __DARWIN_ALIGN32(p: usize) -> usize { diff --git a/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 7d01e3e0d..b3a5be449 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1133,7 +1133,7 @@ pub const PROC_REAP_STATUS: ::c_int = 0x0003; pub const PROC_PDEATHSIG_CTL: ::c_int = 0x0004; pub const PROC_PDEATHSIG_STATUS: ::c_int = 0x0005; -// https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/net/if.h#L101 +// https://github.com/DragonFlyBSD/DragonFlyBSD/blob/HEAD/sys/net/if.h#L101 pub const IFF_UP: ::c_int = 0x1; // interface is up pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging diff --git a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs index 633d1dac3..4138af576 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -5273,7 +5273,6 @@ extern "C" { pub fn fls(value: ::c_int) -> ::c_int; pub fn flsl(value: ::c_long) -> ::c_int; pub fn flsll(value: ::c_longlong) -> ::c_int; - pub fn malloc_usable_size(ptr: *const ::c_void) -> ::size_t; pub fn malloc_stats_print( write_cb: unsafe extern "C" fn(*mut ::c_void, *const ::c_char), cbopaque: *mut ::c_void, diff --git a/vendor/libc/src/unix/bsd/freebsdlike/mod.rs b/vendor/libc/src/unix/bsd/freebsdlike/mod.rs index f328f0dd7..fe69ca420 100644 --- a/vendor/libc/src/unix/bsd/freebsdlike/mod.rs +++ b/vendor/libc/src/unix/bsd/freebsdlike/mod.rs @@ -1339,7 +1339,7 @@ pub const CMGROUP_MAX: usize = 16; pub const EUI64_LEN: usize = 8; -// https://github.com/freebsd/freebsd/blob/master/sys/net/bpf.h +// https://github.com/freebsd/freebsd/blob/HEAD/sys/net/bpf.h pub const BPF_ALIGNMENT: usize = SIZEOF_LONG; // Values for rtprio struct (prio field) and syscall (function argument) @@ -1571,6 +1571,7 @@ extern "C" { mode: ::mode_t, dev: dev_t, ) -> ::c_int; + pub fn malloc_usable_size(ptr: *const ::c_void) -> ::size_t; pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int; pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; diff --git a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs index de5ec3863..46035df31 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1441,7 +1441,7 @@ pub const MS_SYNC: ::c_int = 0x4; pub const MS_INVALIDATE: ::c_int = 0x2; // Here because they are not present on OpenBSD -// (https://github.com/openbsd/src/blob/master/sys/sys/resource.h) +// (https://github.com/openbsd/src/blob/HEAD/sys/sys/resource.h) pub const RLIMIT_SBSIZE: ::c_int = 9; pub const RLIMIT_AS: ::c_int = 10; pub const RLIMIT_NTHR: ::c_int = 11; diff --git a/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs b/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs index 3b87dc211..7fe81b3aa 100644 --- a/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -110,7 +110,7 @@ s! { pub struct mfs_args { pub fspec: *mut ::c_char, pub export_info: export_args, - // https://github.com/openbsd/src/blob/master/sys/sys/types.h#L134 + // https://github.com/openbsd/src/blob/HEAD/sys/sys/types.h#L134 pub base: *mut ::c_char, pub size: ::c_ulong, } @@ -190,7 +190,7 @@ s! { pub cr_uid: ::uid_t, pub cr_gid: ::gid_t, pub cr_ngroups: ::c_short, - //https://github.com/openbsd/src/blob/master/sys/sys/syslimits.h#L44 + //https://github.com/openbsd/src/blob/HEAD/sys/sys/syslimits.h#L44 pub cr_groups: [::gid_t; 16], } @@ -1515,7 +1515,7 @@ pub const OLCUC: ::tcflag_t = 0x20; pub const ONOCR: ::tcflag_t = 0x40; pub const ONLRET: ::tcflag_t = 0x80; -//https://github.com/openbsd/src/blob/master/sys/sys/mount.h +//https://github.com/openbsd/src/blob/HEAD/sys/sys/mount.h pub const ISOFSMNT_NORRIP: ::c_int = 0x1; // disable Rock Ridge Ext pub const ISOFSMNT_GENS: ::c_int = 0x2; // enable generation numbers pub const ISOFSMNT_EXTATT: ::c_int = 0x4; // enable extended attr @@ -1579,7 +1579,7 @@ pub const TMPFS_ARGS_VERSION: ::c_int = 1; pub const MAP_STACK: ::c_int = 0x4000; pub const MAP_CONCEAL: ::c_int = 0x8000; -// https://github.com/openbsd/src/blob/master/sys/net/if.h#L187 +// https://github.com/openbsd/src/blob/HEAD/sys/net/if.h#L187 pub const IFF_UP: ::c_int = 0x1; // interface is up pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging diff --git a/vendor/libc/src/unix/haiku/mod.rs b/vendor/libc/src/unix/haiku/mod.rs index b34b7ca68..24aa599c0 100644 --- a/vendor/libc/src/unix/haiku/mod.rs +++ b/vendor/libc/src/unix/haiku/mod.rs @@ -979,7 +979,7 @@ pub const MADV_WILLNEED: ::c_int = 4; pub const MADV_DONTNEED: ::c_int = 5; pub const MADV_FREE: ::c_int = 6; -// https://github.com/haiku/haiku/blob/master/headers/posix/net/if.h#L80 +// https://github.com/haiku/haiku/blob/HEAD/headers/posix/net/if.h#L80 pub const IFF_UP: ::c_int = 0x0001; pub const IFF_BROADCAST: ::c_int = 0x0002; // valid broadcast address pub const IFF_LOOPBACK: ::c_int = 0x0008; diff --git a/vendor/libc/src/unix/linux_like/android/mod.rs b/vendor/libc/src/unix/linux_like/android/mod.rs index fd4b0593b..c65e737e4 100644 --- a/vendor/libc/src/unix/linux_like/android/mod.rs +++ b/vendor/libc/src/unix/linux_like/android/mod.rs @@ -1441,12 +1441,26 @@ pub const SO_PEERSEC: ::c_int = 31; pub const SO_SNDBUFFORCE: ::c_int = 32; pub const SO_RCVBUFFORCE: ::c_int = 33; pub const SO_PASSSEC: ::c_int = 34; +pub const SO_TIMESTAMPNS: ::c_int = 35; +// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35; pub const SO_MARK: ::c_int = 36; +pub const SO_TIMESTAMPING: ::c_int = 37; +// pub const SO_TIMESTAMPING_OLD: ::c_int = 37; pub const SO_PROTOCOL: ::c_int = 38; pub const SO_DOMAIN: ::c_int = 39; pub const SO_RXQ_OVFL: ::c_int = 40; pub const SO_PEEK_OFF: ::c_int = 42; pub const SO_BUSY_POLL: ::c_int = 46; +pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54; +pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58; +pub const SO_TIMESTAMP_NEW: ::c_int = 63; +pub const SO_TIMESTAMPNS_NEW: ::c_int = 64; +pub const SO_TIMESTAMPING_NEW: ::c_int = 65; + +// Defined in unix/linux_like/mod.rs +// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; +pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; +pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING; pub const IPTOS_ECN_NOTECT: u8 = 0x00; @@ -1817,6 +1831,7 @@ pub const NLM_F_MULTI: ::c_int = 2; pub const NLM_F_ACK: ::c_int = 4; pub const NLM_F_ECHO: ::c_int = 8; pub const NLM_F_DUMP_INTR: ::c_int = 16; +pub const NLM_F_DUMP_FILTERED: ::c_int = 32; pub const NLM_F_ROOT: ::c_int = 0x100; pub const NLM_F_MATCH: ::c_int = 0x200; @@ -2466,8 +2481,7 @@ pub const IFF_PERSIST: ::c_int = 0x0800; pub const IFF_NOFILTER: ::c_int = 0x1000; // start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h -// from https://android.googlesource.com/ -// platform/bionic/+/master/libc/kernel/uapi/linux/if_ether.h +// from https://android.googlesource.com/platform/bionic/+/HEAD/libc/kernel/uapi/linux/if_ether.h pub const ETH_ALEN: ::c_int = 6; pub const ETH_HLEN: ::c_int = 14; pub const ETH_ZLEN: ::c_int = 60; @@ -2609,6 +2623,23 @@ pub const SIOCSIFMAP: ::c_ulong = 0x00008971; pub const MODULE_INIT_IGNORE_MODVERSIONS: ::c_uint = 0x0001; pub const MODULE_INIT_IGNORE_VERMAGIC: ::c_uint = 0x0002; +// linux/net_tstamp.h +pub const SOF_TIMESTAMPING_TX_HARDWARE: ::c_uint = 1 << 0; +pub const SOF_TIMESTAMPING_TX_SOFTWARE: ::c_uint = 1 << 1; +pub const SOF_TIMESTAMPING_RX_HARDWARE: ::c_uint = 1 << 2; +pub const SOF_TIMESTAMPING_RX_SOFTWARE: ::c_uint = 1 << 3; +pub const SOF_TIMESTAMPING_SOFTWARE: ::c_uint = 1 << 4; +pub const SOF_TIMESTAMPING_SYS_HARDWARE: ::c_uint = 1 << 5; +pub const SOF_TIMESTAMPING_RAW_HARDWARE: ::c_uint = 1 << 6; +pub const SOF_TIMESTAMPING_OPT_ID: ::c_uint = 1 << 7; +pub const SOF_TIMESTAMPING_TX_SCHED: ::c_uint = 1 << 8; +pub const SOF_TIMESTAMPING_TX_ACK: ::c_uint = 1 << 9; +pub const SOF_TIMESTAMPING_OPT_CMSG: ::c_uint = 1 << 10; +pub const SOF_TIMESTAMPING_OPT_TSONLY: ::c_uint = 1 << 11; +pub const SOF_TIMESTAMPING_OPT_STATS: ::c_uint = 1 << 12; +pub const SOF_TIMESTAMPING_OPT_PKTINFO: ::c_uint = 1 << 13; +pub const SOF_TIMESTAMPING_OPT_TX_SWHW: ::c_uint = 1 << 14; + #[deprecated( since = "0.2.55", note = "ENOATTR is not available on Android; use ENODATA instead" @@ -3384,7 +3415,13 @@ extern "C" { pub fn sendfile( out_fd: ::c_int, in_fd: ::c_int, - offset: *mut off_t, + offset: *mut ::off_t, + count: ::size_t, + ) -> ::ssize_t; + pub fn sendfile64( + out_fd: ::c_int, + in_fd: ::c_int, + offset: *mut ::off64_t, count: ::size_t, ) -> ::ssize_t; pub fn setfsgid(gid: ::gid_t) -> ::c_int; @@ -3504,7 +3541,9 @@ extern "C" { pub fn gettid() -> ::pid_t; + /// Only available in API Version 28+ 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 pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int; @@ -3550,6 +3589,13 @@ extern "C" { pub fn sync(); pub fn syncfs(fd: ::c_int) -> ::c_int; + + pub fn memmem( + haystack: *const ::c_void, + haystacklen: ::size_t, + needle: *const ::c_void, + needlelen: ::size_t, + ) -> *mut ::c_void; } cfg_if! { diff --git a/vendor/libc/src/unix/linux_like/linux/align.rs b/vendor/libc/src/unix/linux_like/linux/align.rs index cd4bbc721..97f811dac 100644 --- a/vendor/libc/src/unix/linux_like/linux/align.rs +++ b/vendor/libc/src/unix/linux_like/linux/align.rs @@ -176,6 +176,17 @@ macro_rules! expand_align { __res1: u8, pub data: [u8; CANFD_MAX_DLEN], } + + #[repr(align(8))] + #[allow(missing_debug_implementations)] + pub struct canxl_frame { + pub prio: canid_t, + pub flags: u8, + pub sdt: u8, + pub len: u16, + pub af: u32, + pub data: [u8; CANXL_MAX_DLEN], + } } }; } diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs index 4cae9c1c3..dc191f51f 100644 --- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs +++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs @@ -17,10 +17,10 @@ s! { #[repr(align(16))] pub struct mcontext_t { - pub sc_pc: ::c_ulonglong, - pub sc_regs: [::c_ulonglong; 32], - pub sc_flags: ::c_ulong, - pub sc_extcontext: [u64; 0], + pub __pc: ::c_ulonglong, + pub __gregs: [::c_ulonglong; 32], + pub __flags: ::c_uint, + pub __extcontext: [::c_ulonglong; 0], } #[repr(align(8))] diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs index af2825b60..ea59181bc 100644 --- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs @@ -189,6 +189,21 @@ s! { __unused4: ::c_ulong, __unused5: ::c_ulong } + + pub struct user_regs_struct { + pub regs: [u64; 32], + pub orig_a0: u64, + pub csr_era: u64, + pub csr_badv: u64, + pub reserved: [u64; 10], + + } + + pub struct user_fp_struct { + pub fpr: [u64; 32], + pub fcc: u64, + pub fcsr: u32, + } } pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; @@ -549,7 +564,7 @@ pub const SYS_landlock_add_rule: ::c_long = 445; pub const SYS_landlock_restrict_self: ::c_long = 446; pub const SYS_process_mrelease: ::c_long = 448; pub const SYS_futex_waitv: ::c_long = 449; -//pub const SYS_set_mempolicy_home_node: ::c_long = 450; +pub const SYS_set_mempolicy_home_node: ::c_long = 450; pub const POSIX_FADV_DONTNEED: ::c_int = 4; pub const POSIX_FADV_NOREUSE: ::c_int = 5; @@ -684,6 +699,8 @@ pub const ENOTRECOVERABLE: ::c_int = 131; pub const ERFKILL: ::c_int = 132; pub const EHWPOISON: ::c_int = 133; +pub const MADV_SOFT_OFFLINE: ::c_int = 101; + pub const MAP_NORESERVE: ::c_int = 0x4000; pub const MAP_ANONYMOUS: ::c_int = 0x0020; pub const MAP_ANON: ::c_int = 0x0020; @@ -695,6 +712,7 @@ pub const MAP_POPULATE: ::c_int = 0x8000; pub const MAP_NONBLOCK: ::c_int = 0x10000; pub const MAP_STACK: ::c_int = 0x20000; pub const MAP_HUGETLB: ::c_int = 0x40000; +pub const MAP_SYNC: ::c_int = 0x080000; pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002; pub const MCL_ONFAULT: ::c_int = 0x0004; @@ -746,6 +764,8 @@ pub const PTRACE_GETFPXREGS: ::c_uint = 18; pub const PTRACE_SETFPXREGS: ::c_uint = 19; pub const PTRACE_GETREGS: ::c_uint = 12; pub const PTRACE_SETREGS: ::c_uint = 13; +pub const PTRACE_SYSEMU: ::c_uint = 31; +pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32; pub const RTLD_DEEPBIND: ::c_int = 0x8; pub const RTLD_GLOBAL: ::c_int = 0x100; @@ -846,6 +866,7 @@ pub const ECHOPRT: ::tcflag_t = 0x00000400; pub const ECHOCTL: ::tcflag_t = 0x00000200; pub const ISIG: ::tcflag_t = 0x00000001; pub const ICANON: ::tcflag_t = 0x00000002; +pub const XCASE: ::tcflag_t = 0x00000004; pub const PENDIN: ::tcflag_t = 0x00004000; pub const NOFLSH: ::tcflag_t = 0x00000080; diff --git a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs index e88ad4eb2..ba4664bf5 100644 --- a/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs @@ -1302,6 +1302,9 @@ extern "C" { result: *mut *mut ::group, ) -> ::c_int; + pub fn putpwent(p: *const ::passwd, stream: *mut ::FILE) -> ::c_int; + pub fn putgrent(grp: *const ::group, stream: *mut ::FILE) -> ::c_int; + pub fn sethostid(hostid: ::c_long) -> ::c_int; pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int; diff --git a/vendor/libc/src/unix/linux_like/linux/mod.rs b/vendor/libc/src/unix/linux_like/linux/mod.rs index 45a383b40..e52b3d3a8 100644 --- a/vendor/libc/src/unix/linux_like/linux/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/mod.rs @@ -61,11 +61,6 @@ impl ::Clone for fpos64_t { } s! { - pub struct rlimit64 { - pub rlim_cur: rlim64_t, - pub rlim_max: rlim64_t, - } - pub struct glob_t { pub gl_pathc: ::size_t, pub gl_pathv: *mut *mut c_char, @@ -685,6 +680,11 @@ s! { pub struct sctp_authinfo { pub auth_keynumber: ::__u16, } + + pub struct rlimit64 { + pub rlim_cur: rlim64_t, + pub rlim_max: rlim64_t, + } } s_no_extra_traits! { @@ -703,14 +703,6 @@ s_no_extra_traits! { pub d_name: [::c_char; 256], } - pub struct dirent64 { - pub d_ino: ::ino64_t, - pub d_off: ::off64_t, - pub d_reclen: ::c_ushort, - pub d_type: ::c_uchar, - pub d_name: [::c_char; 256], - } - pub struct sockaddr_alg { pub salg_family: ::sa_family_t, pub salg_type: [::c_uchar; 14], @@ -804,6 +796,14 @@ s_no_extra_traits! { pub tx_type: ::c_int, pub rx_filter: ::c_int, } + + pub struct dirent64 { + pub d_ino: ::ino64_t, + pub d_off: ::off64_t, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } } s_no_extra_traits! { @@ -3723,9 +3723,11 @@ pub const CAN_ERR_FLAG: canid_t = 0x20000000; pub const CAN_SFF_MASK: canid_t = 0x000007FF; pub const CAN_EFF_MASK: canid_t = 0x1FFFFFFF; pub const CAN_ERR_MASK: canid_t = 0x1FFFFFFF; +pub const CANXL_PRIO_MASK: ::canid_t = CAN_SFF_MASK; pub const CAN_SFF_ID_BITS: ::c_int = 11; pub const CAN_EFF_ID_BITS: ::c_int = 29; +pub const CANXL_PRIO_BITS: ::c_int = CAN_SFF_ID_BITS; pub const CAN_MAX_DLC: ::c_int = 8; pub const CAN_MAX_DLEN: usize = 8; @@ -3735,10 +3737,26 @@ pub const CANFD_MAX_DLEN: usize = 64; pub const CANFD_BRS: ::c_int = 0x01; pub const CANFD_ESI: ::c_int = 0x02; +pub const CANXL_MIN_DLC: ::c_int = 0; +pub const CANXL_MAX_DLC: ::c_int = 2047; +pub const CANXL_MAX_DLC_MASK: ::c_int = 0x07FF; +pub const CANXL_MIN_DLEN: usize = 1; +pub const CANXL_MAX_DLEN: usize = 2048; + +pub const CANXL_XLF: ::c_int = 0x80; +pub const CANXL_SEC: ::c_int = 0x01; + cfg_if! { if #[cfg(libc_align)] { pub const CAN_MTU: usize = ::mem::size_of::<can_frame>(); pub const CANFD_MTU: usize = ::mem::size_of::<canfd_frame>(); + pub const CANXL_MTU: usize = ::mem::size_of::<canxl_frame>(); + // FIXME: use `core::mem::offset_of!` once that is available + // https://github.com/rust-lang/rfcs/pull/3308 + // pub const CANXL_HDR_SIZE: usize = core::mem::offset_of!(canxl_frame, data); + pub const CANXL_HDR_SIZE: usize = 12; + pub const CANXL_MIN_MTU: usize = CANXL_HDR_SIZE + 64; + pub const CANXL_MAX_MTU: usize = CANXL_MTU; } } @@ -3764,6 +3782,7 @@ pub const CAN_RAW_LOOPBACK: ::c_int = 3; pub const CAN_RAW_RECV_OWN_MSGS: ::c_int = 4; pub const CAN_RAW_FD_FRAMES: ::c_int = 5; pub const CAN_RAW_JOIN_FILTERS: ::c_int = 6; +pub const CAN_RAW_XL_FRAMES: ::c_int = 7; // linux/can/j1939.h pub const SOL_CAN_J1939: ::c_int = SOL_CAN_BASE + CAN_J1939; @@ -4280,21 +4299,8 @@ extern "C" { pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; pub fn __errno_location() -> *mut ::c_int; - pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE; - pub fn freopen64( - filename: *const c_char, - mode: *const c_char, - file: *mut ::FILE, - ) -> *mut ::FILE; - pub fn tmpfile64() -> *mut ::FILE; - pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; - pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; - pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int; - pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; - pub fn fallocate64(fd: ::c_int, mode: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int; pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; - pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int; pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t; pub fn getxattr( path: *const c_char, @@ -4595,12 +4601,6 @@ extern "C" { offset: *mut off_t, count: ::size_t, ) -> ::ssize_t; - pub fn sendfile64( - out_fd: ::c_int, - in_fd: ::c_int, - offset: *mut off64_t, - count: ::size_t, - ) -> ::ssize_t; pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; pub fn getgrgid_r( gid: ::gid_t, @@ -4852,6 +4852,40 @@ extern "C" { ) -> ::ssize_t; } +// LFS64 extensions +// +// * musl has 64-bit versions only so aliases the LFS64 symbols to the standard ones +cfg_if! { + if #[cfg(not(target_env = "musl"))] { + extern "C" { + pub fn fallocate64( + fd: ::c_int, + mode: ::c_int, + offset: ::off64_t, + len: ::off64_t + ) -> ::c_int; + pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; + pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn freopen64( + filename: *const c_char, + mode: *const c_char, + file: *mut ::FILE, + ) -> *mut ::FILE; + pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int; + pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; + pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; + pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int; + pub fn sendfile64( + out_fd: ::c_int, + in_fd: ::c_int, + offset: *mut off64_t, + count: ::size_t, + ) -> ::ssize_t; + pub fn tmpfile64() -> *mut ::FILE; + } + } +} + cfg_if! { if #[cfg(target_env = "uclibc")] { mod uclibc; diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs b/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs index 3b998329b..b1669ade7 100644 --- a/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs +++ b/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs @@ -257,6 +257,9 @@ pub const MAP_STACK: ::c_int = 0x020000; pub const MAP_HUGETLB: ::c_int = 0x040000; pub const MAP_SYNC: ::c_int = 0x080000; +pub const PTRACE_SYSEMU: ::c_int = 0x1d; +pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 0x1e; + pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; pub const SOCK_SEQPACKET: ::c_int = 5; diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs index 9ce6a9fd3..bf7a4f59c 100644 --- a/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs @@ -184,22 +184,6 @@ s! { __pad1: ::c_ulong, __pad2: ::c_ulong, } - - pub struct flock { - pub l_type: ::c_short, - pub l_whence: ::c_short, - pub l_start: ::off_t, - pub l_len: ::off_t, - pub l_pid: ::pid_t, - } - - pub struct flock64 { - pub l_type: ::c_short, - pub l_whence: ::c_short, - pub l_start: ::off64_t, - pub l_len: ::off64_t, - pub l_pid: ::pid_t, - } } //pub const RLIM_INFINITY: ::rlim_t = !0; diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs index c319b91b6..aaca917fa 100644 --- a/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs @@ -456,6 +456,9 @@ pub const FLUSHO: ::tcflag_t = 0x00001000; pub const POLLWRNORM: ::c_short = 0x100; pub const POLLWRBAND: ::c_short = 0x200; +pub const PTRACE_SYSEMU: ::c_int = 31; +pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 32; + // Syscall table pub const SYS_restart_syscall: ::c_long = 0; pub const SYS_exit: ::c_long = 1; diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs b/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs index 0bb4cf837..c9bd94135 100644 --- a/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs +++ b/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs @@ -173,6 +173,9 @@ pub const MAP_STACK: ::c_int = 0x020000; pub const MAP_HUGETLB: ::c_int = 0x040000; pub const MAP_SYNC: ::c_int = 0x080000; +pub const PTRACE_SYSEMU: ::c_int = 0x1d; +pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 0x1e; + pub const SOCK_STREAM: ::c_int = 1; pub const SOCK_DGRAM: ::c_int = 2; diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs index f354293e0..9e9dbf6c8 100644 --- a/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs @@ -173,22 +173,6 @@ s! { __unused5: ::c_ulong, __unused6: ::c_ulong, } - - pub struct flock { - pub l_type: ::c_short, - pub l_whence: ::c_short, - pub l_start: ::off_t, - pub l_len: ::off_t, - pub l_pid: ::pid_t, - } - - pub struct flock64 { - pub l_type: ::c_short, - pub l_whence: ::c_short, - pub l_start: ::off64_t, - pub l_len: ::off64_t, - pub l_pid: ::pid_t, - } } pub const SYS_read: ::c_long = 63; diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs b/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs index d7dcce615..f338dcc54 100644 --- a/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs +++ b/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs @@ -60,33 +60,33 @@ s! { } pub struct statfs { - pub f_type: ::c_ulong, - pub f_bsize: ::c_ulong, + pub f_type: ::c_uint, + pub f_bsize: ::c_uint, pub f_blocks: ::fsblkcnt_t, pub f_bfree: ::fsblkcnt_t, pub f_bavail: ::fsblkcnt_t, pub f_files: ::fsfilcnt_t, pub f_ffree: ::fsfilcnt_t, pub f_fsid: ::fsid_t, - pub f_namelen: ::c_ulong, - pub f_frsize: ::c_ulong, - pub f_flags: ::c_ulong, - pub f_spare: [::c_ulong; 4], + pub f_namelen: ::c_uint, + pub f_frsize: ::c_uint, + pub f_flags: ::c_uint, + pub f_spare: [::c_uint; 4], } pub struct statfs64 { - pub f_type: ::c_ulong, - pub f_bsize: ::c_ulong, + pub f_type: ::c_uint, + pub f_bsize: ::c_uint, pub f_blocks: ::fsblkcnt_t, pub f_bfree: ::fsblkcnt_t, pub f_bavail: ::fsblkcnt_t, pub f_files: ::fsfilcnt_t, pub f_ffree: ::fsfilcnt_t, pub f_fsid: ::fsid_t, - pub f_namelen: ::c_ulong, - pub f_frsize: ::c_ulong, - pub f_flags: ::c_ulong, - pub f_spare: [::c_ulong; 4], + pub f_namelen: ::c_uint, + pub f_frsize: ::c_uint, + pub f_flags: ::c_uint, + pub f_spare: [::c_uint; 4], } } @@ -145,6 +145,7 @@ pub const ETIMEDOUT: ::c_int = 110; pub const O_APPEND: ::c_int = 1024; pub const O_CREAT: ::c_int = 64; pub const O_EXCL: ::c_int = 128; +pub const O_LARGEFILE: ::c_int = 0x8000; pub const O_NONBLOCK: ::c_int = 2048; pub const SA_NOCLDWAIT: ::c_int = 2; pub const SA_ONSTACK: ::c_int = 0x08000000; @@ -179,6 +180,9 @@ pub const MAP_STACK: ::c_int = 0x020000; pub const MAP_HUGETLB: ::c_int = 0x040000; pub const MAP_SYNC: ::c_int = 0x080000; +pub const PTRACE_SYSEMU: ::c_int = 31; +pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 32; + pub const EDEADLOCK: ::c_int = 35; pub const ENAMETOOLONG: ::c_int = 36; pub const ENOLCK: ::c_int = 37; diff --git a/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs index 8198dc2f3..9decf91bc 100644 --- a/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs @@ -682,6 +682,9 @@ pub const O_RSYNC: ::c_int = 1052672; pub const O_DSYNC: ::c_int = 4096; pub const O_ASYNC: ::c_int = 0x2000; +pub const PTRACE_SYSEMU: ::c_int = 31; +pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 32; + pub const SIGSTKSZ: ::size_t = 8192; pub const MINSIGSTKSZ: ::size_t = 2048; diff --git a/vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs b/vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs new file mode 100644 index 000000000..27c1d2583 --- /dev/null +++ b/vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs @@ -0,0 +1,241 @@ +#[inline] +pub unsafe extern "C" fn creat64(path: *const ::c_char, mode: ::mode_t) -> ::c_int { + ::creat(path, mode) +} + +#[inline] +pub unsafe extern "C" fn fallocate64( + fd: ::c_int, + mode: ::c_int, + offset: ::off64_t, + len: ::off64_t, +) -> ::c_int { + ::fallocate(fd, mode, offset, len) +} + +#[inline] +pub unsafe extern "C" fn fgetpos64(stream: *mut ::FILE, pos: *mut ::fpos64_t) -> ::c_int { + ::fgetpos(stream, pos as *mut _) +} + +#[inline] +pub unsafe extern "C" fn fopen64(pathname: *const ::c_char, mode: *const ::c_char) -> *mut ::FILE { + ::fopen(pathname, mode) +} + +#[inline] +pub unsafe extern "C" fn freopen64( + pathname: *const ::c_char, + mode: *const ::c_char, + stream: *mut ::FILE, +) -> *mut ::FILE { + ::freopen(pathname, mode, stream) +} + +#[inline] +pub unsafe extern "C" fn fseeko64( + stream: *mut ::FILE, + offset: ::off64_t, + whence: ::c_int, +) -> ::c_int { + ::fseeko(stream, offset, whence) +} + +#[inline] +pub unsafe extern "C" fn fsetpos64(stream: *mut ::FILE, pos: *const ::fpos64_t) -> ::c_int { + ::fsetpos(stream, pos as *mut _) +} + +#[inline] +pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int { + ::fstat(fildes, buf as *mut _) +} + +#[inline] +pub unsafe extern "C" fn fstatat64( + fd: ::c_int, + path: *const ::c_char, + buf: *mut ::stat64, + flag: ::c_int, +) -> ::c_int { + ::fstatat(fd, path, buf as *mut _, flag) +} + +#[inline] +pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int { + ::fstatfs(fd, buf as *mut _) +} + +#[inline] +pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int { + ::fstatvfs(fd, buf as *mut _) +} + +#[inline] +pub unsafe extern "C" fn ftello64(stream: *mut ::FILE) -> ::off64_t { + ::ftello(stream) +} + +#[inline] +pub unsafe extern "C" fn ftruncate64(fd: ::c_int, length: ::off64_t) -> ::c_int { + ::ftruncate(fd, length) +} + +#[inline] +pub unsafe extern "C" fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int { + ::getrlimit(resource, rlim as *mut _) +} + +#[inline] +pub unsafe extern "C" fn lseek64(fd: ::c_int, offset: ::off64_t, whence: ::c_int) -> ::off64_t { + ::lseek(fd, offset, whence) +} + +#[inline] +pub unsafe extern "C" fn lstat64(path: *const ::c_char, buf: *mut ::stat64) -> ::c_int { + ::lstat(path, buf as *mut _) +} + +#[inline] +pub unsafe extern "C" fn mmap64( + addr: *mut ::c_void, + length: ::size_t, + prot: ::c_int, + flags: ::c_int, + fd: ::c_int, + offset: ::off64_t, +) -> *mut ::c_void { + ::mmap(addr, length, prot, flags, fd, offset) +} + +// These functions are variadic in the C ABI since the `mode` argument is "optional". Variadic +// `extern "C"` functions are unstable in Rust so we cannot write a shim function for these +// entrypoints. See https://github.com/rust-lang/rust/issues/44930. +// +// These aliases are mostly fine though, neither function takes a LFS64-namespaced type as an +// argument, nor do their names clash with any declared types. +pub use open as open64; +pub use openat as openat64; + +#[inline] +pub unsafe extern "C" fn posix_fadvise64( + fd: ::c_int, + offset: ::off64_t, + len: ::off64_t, + advice: ::c_int, +) -> ::c_int { + ::posix_fadvise(fd, offset, len, advice) +} + +#[inline] +pub unsafe extern "C" fn posix_fallocate64( + fd: ::c_int, + offset: ::off64_t, + len: ::off64_t, +) -> ::c_int { + ::posix_fallocate(fd, offset, len) +} + +#[inline] +pub unsafe extern "C" fn pread64( + fd: ::c_int, + buf: *mut ::c_void, + count: ::size_t, + offset: ::off64_t, +) -> ::ssize_t { + ::pread(fd, buf, count, offset) +} + +#[inline] +pub unsafe extern "C" fn preadv64( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off64_t, +) -> ::ssize_t { + ::preadv(fd, iov, iovcnt, offset) +} + +#[inline] +pub unsafe extern "C" fn prlimit64( + pid: ::pid_t, + resource: ::c_int, + new_limit: *const ::rlimit64, + old_limit: *mut ::rlimit64, +) -> ::c_int { + ::prlimit(pid, resource, new_limit as *mut _, old_limit as *mut _) +} + +#[inline] +pub unsafe extern "C" fn pwrite64( + fd: ::c_int, + buf: *const ::c_void, + count: ::size_t, + offset: ::off64_t, +) -> ::ssize_t { + ::pwrite(fd, buf, count, offset) +} + +#[inline] +pub unsafe extern "C" fn pwritev64( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off64_t, +) -> ::ssize_t { + ::pwritev(fd, iov, iovcnt, offset) +} + +#[inline] +pub unsafe extern "C" fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64 { + ::readdir(dirp) as *mut _ +} + +#[inline] +pub unsafe extern "C" fn readdir64_r( + dirp: *mut ::DIR, + entry: *mut ::dirent64, + result: *mut *mut ::dirent64, +) -> ::c_int { + ::readdir_r(dirp, entry as *mut _, result as *mut _) +} + +#[inline] +pub unsafe extern "C" fn sendfile64( + out_fd: ::c_int, + in_fd: ::c_int, + offset: *mut ::off64_t, + count: ::size_t, +) -> ::ssize_t { + ::sendfile(out_fd, in_fd, offset, count) +} + +#[inline] +pub unsafe extern "C" fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int { + ::setrlimit(resource, rlim as *mut _) +} + +#[inline] +pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int { + ::stat(pathname, statbuf as *mut _) +} + +#[inline] +pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int { + ::statfs(pathname, buf as *mut _) +} + +#[inline] +pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int { + ::statvfs(path, buf as *mut _) +} + +#[inline] +pub unsafe extern "C" fn tmpfile64() -> *mut ::FILE { + ::tmpfile() +} + +#[inline] +pub unsafe extern "C" fn truncate64(path: *const ::c_char, length: ::off64_t) -> ::c_int { + ::truncate(path, length) +} diff --git a/vendor/libc/src/unix/linux_like/linux/musl/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/mod.rs index 37a8ca2af..4c6053389 100644 --- a/vendor/libc/src/unix/linux_like/linux/musl/mod.rs +++ b/vendor/libc/src/unix/linux_like/linux/musl/mod.rs @@ -22,8 +22,6 @@ pub type fsblkcnt_t = ::c_ulonglong; pub type fsfilcnt_t = ::c_ulonglong; pub type rlim_t = ::c_ulonglong; -pub type flock64 = flock; - cfg_if! { if #[cfg(doc)] { // Used in `linux::arch` to define ioctl constants. @@ -189,6 +187,14 @@ s! { pub l_pid: ::pid_t, } + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + pub struct regex_t { __re_nsub: ::size_t, __opaque: *mut ::c_void, @@ -719,8 +725,6 @@ extern "C" { timeout: *mut ::timespec, ) -> ::c_int; - pub fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int; - pub fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int; pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; pub fn prlimit( @@ -729,13 +733,6 @@ extern "C" { new_limit: *const ::rlimit, old_limit: *mut ::rlimit, ) -> ::c_int; - pub fn prlimit64( - pid: ::pid_t, - resource: ::c_int, - new_limit: *const ::rlimit64, - old_limit: *mut ::rlimit64, - ) -> ::c_int; - pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; pub fn ptrace(request: ::c_int, ...) -> ::c_long; @@ -784,6 +781,10 @@ extern "C" { pub fn basename(path: *mut ::c_char) -> *mut ::c_char; } +// Alias <foo> to <foo>64 to mimic glibc's LFS64 support +mod lfs64; +pub use self::lfs64::*; + cfg_if! { if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64", diff --git a/vendor/libc/src/unix/linux_like/mod.rs b/vendor/libc/src/unix/linux_like/mod.rs index b487da9fa..3117c18b8 100644 --- a/vendor/libc/src/unix/linux_like/mod.rs +++ b/vendor/libc/src/unix/linux_like/mod.rs @@ -918,6 +918,8 @@ pub const IPPROTO_BEETPH: ::c_int = 94; pub const IPPROTO_MPLS: ::c_int = 137; /// Multipath TCP pub const IPPROTO_MPTCP: ::c_int = 262; +/// Ethernet-within-IPv6 encapsulation. +pub const IPPROTO_ETHERNET: ::c_int = 143; pub const MCAST_EXCLUDE: ::c_int = 0; pub const MCAST_INCLUDE: ::c_int = 1; @@ -1694,20 +1696,9 @@ extern "C" { pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int; pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; - pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int; pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; - pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int; - pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int; - pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int; pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void; - pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int; - pub fn posix_fadvise64( - fd: ::c_int, - offset: ::off64_t, - len: ::off64_t, - advise: ::c_int, - ) -> ::c_int; pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; pub fn utimensat( dirfd: ::c_int, @@ -1719,43 +1710,6 @@ extern "C" { pub fn freelocale(loc: ::locale_t); pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; pub fn uselocale(loc: ::locale_t) -> ::locale_t; - pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int; - pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int; - pub fn fstatat64( - dirfd: ::c_int, - pathname: *const c_char, - buf: *mut stat64, - flags: ::c_int, - ) -> ::c_int; - pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int; - pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t; - pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int; - pub fn mmap64( - addr: *mut ::c_void, - len: ::size_t, - prot: ::c_int, - flags: ::c_int, - fd: ::c_int, - offset: off64_t, - ) -> *mut ::c_void; - pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; - pub fn openat64(fd: ::c_int, path: *const c_char, oflag: ::c_int, ...) -> ::c_int; - pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t; - pub fn pwrite64( - fd: ::c_int, - buf: *const ::c_void, - count: ::size_t, - offset: off64_t, - ) -> ::ssize_t; - pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; - pub fn readdir64_r( - dirp: *mut ::DIR, - entry: *mut ::dirent64, - result: *mut *mut ::dirent64, - ) -> ::c_int; - pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int; - pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int; - pub fn mknodat( dirfd: ::c_int, pathname: *const ::c_char, @@ -1827,8 +1781,70 @@ extern "C" { pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char; } +// LFS64 extensions +// +// * musl has 64-bit versions only so aliases the LFS64 symbols to the standard ones +// * ulibc doesn't have preadv64/pwritev64 cfg_if! { - if #[cfg(not(target_env = "uclibc"))] { + if #[cfg(not(target_env = "musl"))] { + extern "C" { + pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int; + pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int; + pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int; + pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int; + pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int; + pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int; + pub fn fstatat64( + dirfd: ::c_int, + pathname: *const c_char, + buf: *mut stat64, + flags: ::c_int, + ) -> ::c_int; + pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int; + pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t; + pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int; + pub fn mmap64( + addr: *mut ::c_void, + len: ::size_t, + prot: ::c_int, + flags: ::c_int, + fd: ::c_int, + offset: off64_t, + ) -> *mut ::c_void; + pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; + pub fn openat64(fd: ::c_int, path: *const c_char, oflag: ::c_int, ...) -> ::c_int; + pub fn posix_fadvise64( + fd: ::c_int, + offset: ::off64_t, + len: ::off64_t, + advise: ::c_int, + ) -> ::c_int; + pub fn pread64( + fd: ::c_int, + buf: *mut ::c_void, + count: ::size_t, + offset: off64_t + ) -> ::ssize_t; + pub fn pwrite64( + fd: ::c_int, + buf: *const ::c_void, + count: ::size_t, + offset: off64_t, + ) -> ::ssize_t; + pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; + pub fn readdir64_r( + dirp: *mut ::DIR, + entry: *mut ::dirent64, + result: *mut *mut ::dirent64, + ) -> ::c_int; + pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int; + pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int; + } + } +} + +cfg_if! { + if #[cfg(not(any(target_env = "uclibc", target_env = "musl")))] { extern "C" { pub fn preadv64( fd: ::c_int, @@ -1842,6 +1858,13 @@ cfg_if! { iovcnt: ::c_int, offset: ::off64_t, ) -> ::ssize_t; + } + } +} + +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + extern "C" { // uclibc has separate non-const version of this function pub fn forkpty( amaster: *mut ::c_int, diff --git a/vendor/libc/src/unix/mod.rs b/vendor/libc/src/unix/mod.rs index 75d511e39..9b5ce0fce 100644 --- a/vendor/libc/src/unix/mod.rs +++ b/vendor/libc/src/unix/mod.rs @@ -29,7 +29,7 @@ pub type sighandler_t = ::size_t; pub type cc_t = ::c_uchar; cfg_if! { - if #[cfg(any(target_os = "espidf", target_os = "horizon"))] { + if #[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "vita"))] { pub type uid_t = ::c_ushort; pub type gid_t = ::c_ushort; } else if #[cfg(target_os = "nto")] { @@ -1499,6 +1499,11 @@ cfg_if! { timeout: *mut timespec, sigmask: *const sigset_t, ) -> ::c_int; + pub fn sigaction( + signum: ::c_int, + act: *const sigaction, + oldact: *mut sigaction + ) -> ::c_int; } } else { extern { diff --git a/vendor/libc/src/unix/newlib/mod.rs b/vendor/libc/src/unix/newlib/mod.rs index d46844268..ce84f1421 100644 --- a/vendor/libc/src/unix/newlib/mod.rs +++ b/vendor/libc/src/unix/newlib/mod.rs @@ -1,12 +1,23 @@ pub type blkcnt_t = i32; pub type blksize_t = i32; -pub type clockid_t = ::c_ulong; cfg_if! { - if #[cfg(target_os = "espidf")] { + if #[cfg(target_os = "vita")] { + pub type clockid_t = ::c_uint; + } else { + pub type clockid_t = ::c_ulong; + } +} + +cfg_if! { + if #[cfg(any(target_os = "espidf"))] { pub type dev_t = ::c_short; pub type ino_t = ::c_ushort; pub type off_t = ::c_long; + } else if #[cfg(any(target_os = "vita"))] { + pub type dev_t = ::c_short; + pub type ino_t = ::c_ushort; + pub type off_t = ::c_int; } else { pub type dev_t = u32; pub type ino_t = u32; @@ -160,8 +171,12 @@ s! { } pub struct dirent { + #[cfg(not(target_os = "vita"))] pub d_ino: ino_t, + #[cfg(not(target_os = "vita"))] pub d_type: ::c_uchar, + #[cfg(target_os = "vita")] + __offset: [u8; 88], pub d_name: [::c_char; 256usize], } @@ -219,12 +234,11 @@ s! { } pub struct pthread_attr_t { // Unverified - __size: [u64; 7] + __size: [u8; __SIZEOF_PTHREAD_ATTR_T] } pub struct pthread_rwlockattr_t { // Unverified - __lockkind: ::c_int, - __pshared: ::c_int, + __size: [u8; __SIZEOF_PTHREAD_RWLOCKATTR_T] } } @@ -241,6 +255,7 @@ align_const! { }; } pub const NCCS: usize = 32; + cfg_if! { if #[cfg(target_os = "espidf")] { const __PTHREAD_INITIALIZER_BYTE: u8 = 0xff; @@ -251,6 +266,17 @@ cfg_if! { pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8; pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 4; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 12; + pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; + } else if #[cfg(target_os = "vita")] { + const __PTHREAD_INITIALIZER_BYTE: u8 = 0xff; + pub const __SIZEOF_PTHREAD_ATTR_T: usize = 4; + pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 4; + pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; + pub const __SIZEOF_PTHREAD_COND_T: usize = 4; + pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; + pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 4; + pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 4; + pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 4; } else { const __PTHREAD_INITIALIZER_BYTE: u8 = 0; pub const __SIZEOF_PTHREAD_ATTR_T: usize = 56; @@ -260,9 +286,10 @@ cfg_if! { pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; + pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; } } -pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; + pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; pub const __PTHREAD_MUTEX_HAVE_PREV: usize = 1; pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: usize = 1; @@ -273,6 +300,8 @@ pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; cfg_if! { if #[cfg(any(target_os = "horizon", target_os = "espidf"))] { pub const FD_SETSIZE: usize = 64; + } else if #[cfg(target_os = "vita")] { + pub const FD_SETSIZE: usize = 256; } else { pub const FD_SETSIZE: usize = 1024; } @@ -498,8 +527,7 @@ pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC; pub const INET_ADDRSTRLEN: ::c_int = 16; -// https://github. -// com/bminor/newlib/blob/master/newlib/libc/sys/linux/include/net/if.h#L121 +// https://github.com/bminor/newlib/blob/HEAD/newlib/libc/sys/linux/include/net/if.h#L121 pub const IFF_UP: ::c_int = 0x1; // interface is up pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging diff --git a/vendor/libc/src/unix/newlib/vita/mod.rs b/vendor/libc/src/unix/newlib/vita/mod.rs index 801a408b9..6e2e4d3eb 100644 --- a/vendor/libc/src/unix/newlib/vita/mod.rs +++ b/vendor/libc/src/unix/newlib/vita/mod.rs @@ -6,68 +6,96 @@ pub type wchar_t = u32; pub type c_long = i32; pub type c_ulong = u32; +pub type sigset_t = ::c_ulong; + s! { pub struct sockaddr { + pub sa_len: u8, pub sa_family: ::sa_family_t, pub sa_data: [::c_char; 14], } pub struct sockaddr_in6 { + pub sin6_len: u8, pub sin6_family: ::sa_family_t, pub sin6_port: ::in_port_t, pub sin6_flowinfo: u32, pub sin6_addr: ::in6_addr, + pub sin6_vport: ::in_port_t, pub sin6_scope_id: u32, } pub struct sockaddr_in { + pub sin_len: u8, pub sin_family: ::sa_family_t, pub sin_port: ::in_port_t, pub sin_addr: ::in_addr, - pub sin_zero: [u8; 8], + pub sin_vport: ::in_port_t, + pub sin_zero: [u8; 6], } pub struct sockaddr_un { - pub sun_len: ::c_uchar, pub sun_family: ::sa_family_t, - pub sun_path: [::c_char; 104usize], + pub sun_path: [::c_char; 108usize], } pub struct sockaddr_storage { + pub ss_len: u8, pub ss_family: ::sa_family_t, - pub __ss_padding: [u8; 26], + pub __ss_pad1: [u8; 4], + pub __ss_align: i64, + pub __ss_pad2: [u8; 4], } - pub struct sched_param { pub sched_priority: ::c_int, } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_atime: ::time_t, + pub st_mtime: ::time_t, + pub st_ctime: ::time_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_spare4: [::c_long; 2usize], + } } pub const AF_UNIX: ::c_int = 1; -pub const AF_INET6: ::c_int = 23; +pub const AF_INET6: ::c_int = 24; -pub const FIONBIO: ::c_ulong = 0x8004667e; +pub const FIONBIO: ::c_ulong = 1; -pub const POLLIN: ::c_short = 1; -pub const POLLPRI: ::c_short = 2; -pub const POLLOUT: ::c_short = 4; -pub const POLLERR: ::c_short = 8; -pub const POLLHUP: ::c_short = 16; -pub const POLLNVAL: ::c_short = 32; +pub const POLLIN: ::c_short = 0x0001; +pub const POLLPRI: ::c_short = POLLIN; +pub const POLLOUT: ::c_short = 0x0004; +pub const POLLERR: ::c_short = 0x0008; +pub const POLLHUP: ::c_short = 0x0010; +pub const POLLNVAL: ::c_short = 0x0020; pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void; pub const SOL_SOCKET: ::c_int = 0xffff; +pub const SO_NONBLOCK: ::c_int = 0x1100; pub const MSG_OOB: ::c_int = 0x1; pub const MSG_PEEK: ::c_int = 0x2; pub const MSG_DONTROUTE: ::c_int = 0x4; -pub const MSG_WAITALL: ::c_int = 0x8; -pub const MSG_DONTWAIT: ::c_int = 0x10; -pub const MSG_NOSIGNAL: ::c_int = 0x20; -pub const MSG_TRUNC: ::c_int = 0x0100; -pub const MSG_CTRUNC: ::c_int = 0x0200; +pub const MSG_EOR: ::c_int = 0x8; +pub const MSG_TRUNC: ::c_int = 0x10; +pub const MSG_CTRUNC: ::c_int = 0x20; +pub const MSG_WAITALL: ::c_int = 0x40; +pub const MSG_DONTWAIT: ::c_int = 0x80; +pub const MSG_BCAST: ::c_int = 0x100; +pub const MSG_MCAST: ::c_int = 0x200; pub const UTIME_OMIT: c_long = -1; pub const AT_FDCWD: ::c_int = -2; @@ -111,7 +139,7 @@ pub const EAI_OVERFLOW: ::c_int = -12; pub const _SC_PAGESIZE: ::c_int = 8; pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 51; -pub const PTHREAD_STACK_MIN: ::size_t = 200; +pub const PTHREAD_STACK_MIN: ::size_t = 32 * 1024; extern "C" { pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; @@ -171,5 +199,3 @@ extern "C" { pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; } - -pub use crate::unix::newlib::generic::{sigset_t, stat}; diff --git a/vendor/libc/src/unix/nto/mod.rs b/vendor/libc/src/unix/nto/mod.rs index 5d13568e4..a79450f4e 100644 --- a/vendor/libc/src/unix/nto/mod.rs +++ b/vendor/libc/src/unix/nto/mod.rs @@ -80,6 +80,33 @@ impl ::Clone for timezone { } s! { + pub struct dirent_extra { + pub d_datalen: u16, + pub d_type: u16, + pub d_reserved: u32, + } + + pub struct stat { + pub st_ino: ::ino_t, + pub st_size: ::off_t, + pub st_dev: ::dev_t, + pub st_rdev: ::dev_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub __old_st_mtime: ::_Time32t, + pub __old_st_atime: ::_Time32t, + pub __old_st_ctime: ::_Time32t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_blocksize: ::blksize_t, + pub st_nblocks: i32, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_mtim: ::timespec, + pub st_atim: ::timespec, + pub st_ctim: ::timespec, + } + pub struct ip_mreq { pub imr_multiaddr: in_addr, pub imr_interface: in_addr, @@ -641,7 +668,9 @@ s_no_extra_traits! { pub struct sigevent { pub sigev_notify: ::c_int, - __sigev_un1: usize, // union + pub __padding1: ::c_int, + pub sigev_signo: ::c_int, // union + pub __padding2: ::c_int, pub sigev_value: ::sigval, __sigev_un2: usize, // union @@ -654,33 +683,6 @@ s_no_extra_traits! { pub d_name: [::c_char; 1], // flex array } - pub struct dirent_extra { - pub d_datalen: u16, - pub d_type: u16, - pub d_reserved: u32, - } - - pub struct stat { - pub st_ino: ::ino_t, - pub st_size: ::off_t, - pub st_dev: ::dev_t, - pub st_rdev: ::dev_t, - pub st_uid: ::uid_t, - pub st_gid: ::gid_t, - pub __old_st_mtime: ::_Time32t, - pub __old_st_atime: ::_Time32t, - pub __old_st_ctime: ::_Time32t, - pub st_mode: ::mode_t, - pub st_nlink: ::nlink_t, - pub st_blocksize: ::blksize_t, - pub st_nblocks: i32, - pub st_blksize: ::blksize_t, - pub st_blocks: ::blkcnt_t, - pub st_mtim: ::timespec, - pub st_atim: ::timespec, - pub st_ctim: ::timespec, - } - pub struct sigset_t { __val: [u32; 2], } @@ -756,6 +758,37 @@ s_no_extra_traits! { cfg_if! { if #[cfg(feature = "extra_traits")] { + // sigevent + impl PartialEq for sigevent { + fn eq(&self, other: &sigevent) -> bool { + self.sigev_notify == other.sigev_notify + && self.sigev_signo == other.sigev_signo + && self.sigev_value == other.sigev_value + && self.__sigev_un2 + == other.__sigev_un2 + } + } + impl Eq for sigevent {} + impl ::fmt::Debug for sigevent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigevent") + .field("sigev_notify", &self.sigev_notify) + .field("sigev_signo", &self.sigev_signo) + .field("sigev_value", &self.sigev_value) + .field("__sigev_un2", + &self.__sigev_un2) + .finish() + } + } + impl ::hash::Hash for sigevent { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + self.sigev_notify.hash(state); + self.sigev_signo.hash(state); + self.sigev_value.hash(state); + self.__sigev_un2.hash(state); + } + } + impl PartialEq for sockaddr_un { fn eq(&self, other: &sockaddr_un) -> bool { self.sun_len == other.sun_len @@ -767,9 +800,7 @@ cfg_if! { .all(|(a,b)| a == b) } } - impl Eq for sockaddr_un {} - impl ::fmt::Debug for sockaddr_un { fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { f.debug_struct("sockaddr_un") @@ -788,6 +819,168 @@ cfg_if! { } } + // sigset_t + impl PartialEq for sigset_t { + fn eq(&self, other: &sigset_t) -> bool { + self.__val == other.__val + } + } + impl Eq for sigset_t {} + impl ::fmt::Debug for sigset_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigset_t") + .field("__val", &self.__val) + .finish() + } + } + impl ::hash::Hash for sigset_t { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + self.__val.hash(state); + } + } + + // msg + impl ::fmt::Debug for msg { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("msg") + .field("msg_next", &self.msg_next) + .field("msg_type", &self.msg_type) + .field("msg_ts", &self.msg_ts) + .field("msg_spot", &self.msg_spot) + .finish() + } + } + + // msqid_ds + impl ::fmt::Debug for msqid_ds { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("msqid_ds") + .field("msg_perm", &self.msg_perm) + .field("msg_first", &self.msg_first) + .field("msg_cbytes", &self.msg_cbytes) + .field("msg_qnum", &self.msg_qnum) + .field("msg_qbytes", &self.msg_qbytes) + .field("msg_lspid", &self.msg_lspid) + .field("msg_lrpid", &self.msg_lrpid) + .field("msg_stime", &self.msg_stime) + .field("msg_rtime", &self.msg_rtime) + .field("msg_ctime", &self.msg_ctime) + .finish() + } + } + + // sockaddr_dl + impl ::fmt::Debug for sockaddr_dl { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_dl") + .field("sdl_len", &self.sdl_len) + .field("sdl_family", &self.sdl_family) + .field("sdl_index", &self.sdl_index) + .field("sdl_type", &self.sdl_type) + .field("sdl_nlen", &self.sdl_nlen) + .field("sdl_alen", &self.sdl_alen) + .field("sdl_slen", &self.sdl_slen) + .field("sdl_data", &self.sdl_data) + .finish() + } + } + impl PartialEq for sockaddr_dl { + fn eq(&self, other: &sockaddr_dl) -> bool { + self.sdl_len == other.sdl_len + && self.sdl_family == other.sdl_family + && self.sdl_index == other.sdl_index + && self.sdl_type == other.sdl_type + && self.sdl_nlen == other.sdl_nlen + && self.sdl_alen == other.sdl_alen + && self.sdl_slen == other.sdl_slen + && self + .sdl_data + .iter() + .zip(other.sdl_data.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sockaddr_dl {} + impl ::hash::Hash for sockaddr_dl { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + self.sdl_len.hash(state); + self.sdl_family.hash(state); + self.sdl_index.hash(state); + self.sdl_type.hash(state); + self.sdl_nlen.hash(state); + self.sdl_alen.hash(state); + self.sdl_slen.hash(state); + self.sdl_data.hash(state); + } + } + + // sync_t + impl ::fmt::Debug for sync_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sync_t") + .field("__owner", &self.__owner) + .field("__u", &self.__u) + .finish() + } + } + + // pthread_barrier_t + impl ::fmt::Debug for pthread_barrier_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_barrier_t") + .field("__pad", &self.__pad) + .finish() + } + } + + // pthread_rwlock_t + impl ::fmt::Debug for pthread_rwlock_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_rwlock_t") + .field("__active", &self.__active) + .field("__blockedwriters", &self.__blockedwriters) + .field("__blockedreaders", &self.__blockedreaders) + .field("__heavy", &self.__heavy) + .field("__lock", &self.__lock) + .field("__rcond", &self.__rcond) + .field("__wcond", &self.__wcond) + .field("__owner", &self.__owner) + .field("__spare", &self.__spare) + .finish() + } + } + + // syspage_entry + impl ::fmt::Debug for syspage_entry { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("syspage_entry") + .field("size", &self.size) + .field("total_size", &self.total_size) + .field("type_", &self.type_) + .field("num_cpu", &self.num_cpu) + .field("system_private", &self.system_private) + .field("old_asinfo", &self.old_asinfo) + .field("hwinfo", &self.hwinfo) + .field("old_cpuinfo", &self.old_cpuinfo) + .field("old_cacheattr", &self.old_cacheattr) + .field("qtime", &self.qtime) + .field("callout", &self.callout) + .field("callin", &self.callin) + .field("typed_strings", &self.typed_strings) + .field("strings", &self.strings) + .field("old_intrinfo", &self.old_intrinfo) + .field("smp", &self.smp) + .field("pminfo", &self.pminfo) + .field("old_mdriver", &self.old_mdriver) + .field("new_asinfo", &self.new_asinfo) + .field("new_cpuinfo", &self.new_cpuinfo) + .field("new_cacheattr", &self.new_cacheattr) + .field("new_intrinfo", &self.new_intrinfo) + .field("new_mdriver", &self.new_mdriver) + .finish() + } + } + impl PartialEq for utsname { fn eq(&self, other: &utsname) -> bool { self.sysname @@ -868,6 +1061,16 @@ cfg_if! { .finish() } } + impl ::hash::Hash for mq_attr { + fn hash<H: ::hash::Hasher>(&self, state: &mut H) { + self.mq_maxmsg.hash(state); + self.mq_msgsize.hash(state); + self.mq_flags.hash(state); + self.mq_curmsgs.hash(state); + self.mq_sendwait.hash(state); + self.mq_recvwait.hash(state); + } + } impl PartialEq for sockaddr_storage { fn eq(&self, other: &sockaddr_storage) -> bool { @@ -2606,6 +2809,14 @@ f! { }; ::mem::size_of::<sockcred>() + ::mem::size_of::<::gid_t>() * ngrps } + + pub fn major(dev: ::dev_t) -> ::c_uint { + ((dev as ::c_uint) >> 10) & 0x3f + } + + pub fn minor(dev: ::dev_t) -> ::c_uint { + (dev as ::c_uint) & 0x3ff + } } safe_f! { @@ -2644,6 +2855,10 @@ safe_f! { pub {const} fn IPTOS_ECN(x: u8) -> u8 { x & ::IPTOS_ECN_MASK } + + pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t { + ((major << 10) | (minor)) as ::dev_t + } } // Network related functions are provided by libsocket and regex @@ -2658,6 +2873,12 @@ extern "C" { pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; + pub fn mknodat( + __fd: ::c_int, + pathname: *const ::c_char, + mode: ::mode_t, + dev: ::dev_t, + ) -> ::c_int; pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; diff --git a/vendor/libc/src/unix/nto/neutrino.rs b/vendor/libc/src/unix/nto/neutrino.rs index cedd21659..1a6f7da9c 100644 --- a/vendor/libc/src/unix/nto/neutrino.rs +++ b/vendor/libc/src/unix/nto/neutrino.rs @@ -1,6 +1,16 @@ pub type nto_job_t = ::sync_t; s! { + pub struct syspage_entry_info { + pub entry_off: u16, + pub entry_size: u16, + } + pub struct syspage_array_info { + entry_off: u16, + entry_size: u16, + element_size: u16, + } + pub struct intrspin { pub value: ::c_uint, // volatile } @@ -202,16 +212,6 @@ s! { } s_no_extra_traits! { - pub struct syspage_entry_info { - pub entry_off: u16, - pub entry_size: u16, - } - - pub struct syspage_array_info { - entry_off: u16, - entry_size: u16, - element_size: u16, - } #[repr(align(8))] pub struct syspage_entry { diff --git a/vendor/libc/src/unix/redox/mod.rs b/vendor/libc/src/unix/redox/mod.rs index d946f4652..5003cda0a 100644 --- a/vendor/libc/src/unix/redox/mod.rs +++ b/vendor/libc/src/unix/redox/mod.rs @@ -48,6 +48,9 @@ pub type suseconds_t = ::c_int; pub type tcflag_t = u32; pub type time_t = ::c_longlong; pub type id_t = ::c_uint; +pub type pid_t = usize; +pub type uid_t = u32; +pub type gid_t = u32; #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} @@ -256,6 +259,12 @@ s! { pub tm_gmtoff: ::c_long, pub tm_zone: *const ::c_char, } + + pub struct ucred { + pub pid: pid_t, + pub uid: uid_t, + pub gid: gid_t, + } } pub const UTSLENGTH: usize = 65; @@ -278,6 +287,10 @@ pub const PATH_MAX: ::c_int = 4096; pub const F_GETLK: ::c_int = 5; pub const F_SETLK: ::c_int = 6; pub const F_SETLKW: ::c_int = 7; +pub const F_ULOCK: ::c_int = 0; +pub const F_LOCK: ::c_int = 1; +pub const F_TLOCK: ::c_int = 2; +pub const F_TEST: ::c_int = 3; // FIXME: relibc { pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; @@ -1080,6 +1093,12 @@ extern "C" { ) -> ::c_int; pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sigtimedwait( + set: *const sigset_t, + sig: *mut siginfo_t, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; // stdlib.h pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; |