From dc0db358abe19481e475e10c32149b53370f1a1c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:57:31 +0200 Subject: Merging upstream version 1.72.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/libc/src/unix/linux_like/android/mod.rs | 52 ++++- vendor/libc/src/unix/linux_like/linux/align.rs | 11 + .../linux_like/linux/gnu/b64/loongarch64/align.rs | 8 +- .../linux_like/linux/gnu/b64/loongarch64/mod.rs | 23 +- vendor/libc/src/unix/linux_like/linux/gnu/mod.rs | 3 + vendor/libc/src/unix/linux_like/linux/mod.rs | 98 ++++++--- .../src/unix/linux_like/linux/musl/b32/powerpc.rs | 3 + .../unix/linux_like/linux/musl/b32/riscv32/mod.rs | 16 -- .../src/unix/linux_like/linux/musl/b32/x86/mod.rs | 3 + .../unix/linux_like/linux/musl/b64/powerpc64.rs | 3 + .../unix/linux_like/linux/musl/b64/riscv64/mod.rs | 16 -- .../src/unix/linux_like/linux/musl/b64/s390x.rs | 28 ++- .../unix/linux_like/linux/musl/b64/x86_64/mod.rs | 3 + .../libc/src/unix/linux_like/linux/musl/lfs64.rs | 241 +++++++++++++++++++++ vendor/libc/src/unix/linux_like/linux/musl/mod.rs | 23 +- vendor/libc/src/unix/linux_like/mod.rs | 121 ++++++----- 16 files changed, 508 insertions(+), 144 deletions(-) create mode 100644 vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs (limited to 'vendor/libc/src/unix/linux_like') 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::(); pub const CANFD_MTU: usize = ::mem::size_of::(); + pub const CANXL_MTU: usize = ::mem::size_of::(); + // 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 to 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, -- cgit v1.2.3