From 2cb882824afb4caffc7021592566275f83afec73 Mon Sep 17 00:00:00 2001 From: git-bruh Date: Sat, 26 Aug 2023 23:15:25 +0530 Subject: [PATCH] rust: 1.72.0 --- extra/rust/build | 39 +- extra/rust/checksums | 14 +- extra/rust/files/liblfs64.c | 44 + extra/rust/patches/fix-crt-static.patch | 150 -- extra/rust/patches/lfs64-getrandom.patch | 25 - extra/rust/patches/lfs64-libc.patch | 2904 ---------------------- extra/rust/patches/lfs64-rust.patch | 50 +- extra/rust/sources | 12 +- extra/rust/version | 2 +- 9 files changed, 95 insertions(+), 3145 deletions(-) create mode 100644 extra/rust/files/liblfs64.c delete mode 100644 extra/rust/patches/fix-crt-static.patch delete mode 100644 extra/rust/patches/lfs64-getrandom.patch delete mode 100644 extra/rust/patches/lfs64-libc.patch diff --git a/extra/rust/build b/extra/rust/build index ff3e4879..04577355 100755 --- a/extra/rust/build +++ b/extra/rust/build @@ -6,6 +6,28 @@ for p in *.patch; do patch -p1 < "$p" done +mkdir _lib + +( + cd _lib + + : "${AR:=ar}" + : "${CC:=cc}" + + $CC ../liblfs64.c -c -fPIC -o liblfs64.o + $AR rcs liblfs64.a liblfs64.o + + cat > cc < _ mv -f _ compiler/rustc_target/src/spec/linux_musl_base.rs -# Ignore checksums of files modified above. -for p in \ - curl-sys \ - getrandom-0.2.8 \ - libc \ - libc-0.2.138 \ - libc-0.2.139 \ - libc-0.2.140 \ - libc-0.2.143 -do - sed 's/\("files":{\)[^}]*/\1/' vendor/"$p"/.cargo-checksum.json > _ - mv -f _ vendor/"$p"/.cargo-checksum.json -done +sed 's/\("files":{\)[^}]*/\1/' vendor/curl-sys/.cargo-checksum.json > _ +mv -f _ vendor/curl-sys/.cargo-checksum.json cat > config.toml < +#include +#include +#include + +int stat64(char *pathname, struct stat *statbuf) { + return stat(pathname, statbuf); +} + +int fstat64(int fd, struct stat *statbuf) { return fstat(fd, statbuf); } + +int fstatat64(int dirfd, char *pathname, struct stat *statbuf, int flags) { + return fstatat(dirfd, pathname, statbuf, flags); +} + +int lstat64(char *restrict pathname, struct stat *statbuf) { + return lstat(pathname, statbuf); +} + +int truncate64(char *path, off_t length) { return truncate(path, length); } + +int ftruncate64(int fd, off_t length) { return ftruncate(fd, length); } + +off_t lseek64(int fd, off_t offset, int whence) { + return lseek(fd, offset, whence); +} + +int open64(const char *pathname, int flags, + /* Technically this is undefined behaviour, but the `mode` + * value is only checked if the relevant flag is set in `flags` + * so a garbage value will never be read */ + mode_t mode) { + return open(pathname, flags, mode); +} + +struct dirent *readdir64(DIR *dirp) { return readdir(dirp); } + +ssize_t pread64(int fd, void *buf, size_t count, off_t offset) { + return pread(fd, buf, count, offset); +} + +ssize_t pwrite64(int fd, void *buf, size_t count, off_t offset) { + return pwrite(fd, buf, count, offset); +} diff --git a/extra/rust/patches/fix-crt-static.patch b/extra/rust/patches/fix-crt-static.patch deleted file mode 100644 index 6d34eb40..00000000 --- a/extra/rust/patches/fix-crt-static.patch +++ /dev/null @@ -1,150 +0,0 @@ -Patch-Source: https://github.com/rust-lang/rust/pull/111698 --- -From 6b8fcb8e5918911c0ba4e155cb2a97e804c62e81 Mon Sep 17 00:00:00 2001 -From: Amanieu d'Antras -Date: Wed, 17 May 2023 23:53:04 +0200 -Subject: [PATCH] Force all native libraries to be statically linked when - linking a static binary - ---- - compiler/rustc_codegen_ssa/src/back/link.rs | 38 ++++++++++++++++++--- - compiler/rustc_target/src/spec/mod.rs | 11 ++++++ - 2 files changed, 45 insertions(+), 4 deletions(-) - -diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs -index ea06cb02d8baf..91598e8d879ee 100644 ---- a/compiler/rustc_codegen_ssa/src/back/link.rs -+++ b/compiler/rustc_codegen_ssa/src/back/link.rs -@@ -2129,7 +2129,14 @@ fn linker_with_args<'a>( - cmd.add_as_needed(); - - // Local native libraries of all kinds. -- add_local_native_libraries(cmd, sess, archive_builder_builder, codegen_results, tmpdir); -+ add_local_native_libraries( -+ cmd, -+ sess, -+ archive_builder_builder, -+ codegen_results, -+ tmpdir, -+ link_output_kind, -+ ); - - // Upstream rust crates and their non-dynamic native libraries. - add_upstream_rust_crates( -@@ -2139,10 +2146,18 @@ fn linker_with_args<'a>( - codegen_results, - crate_type, - tmpdir, -+ link_output_kind, - ); - - // Dynamic native libraries from upstream crates. -- add_upstream_native_libraries(cmd, sess, archive_builder_builder, codegen_results, tmpdir); -+ add_upstream_native_libraries( -+ cmd, -+ sess, -+ archive_builder_builder, -+ codegen_results, -+ tmpdir, -+ link_output_kind, -+ ); - - // Link with the import library generated for any raw-dylib functions. - for (raw_dylib_name, raw_dylib_imports) in -@@ -2397,6 +2412,7 @@ fn add_native_libs_from_crate( - cnum: CrateNum, - link_static: bool, - link_dynamic: bool, -+ link_output_kind: LinkOutputKind, - ) { - if !sess.opts.unstable_opts.link_native_libraries { - // If `-Zlink-native-libraries=false` is set, then the assumption is that an -@@ -2476,8 +2492,16 @@ fn add_native_libs_from_crate( - } - } - NativeLibKind::Unspecified => { -- if link_dynamic { -- cmd.link_dylib(name, verbatim, true); -+ // If we are generating a static binary, prefer static library when the -+ // link kind is unspecified. -+ if !link_output_kind.can_link_dylib() && !sess.target.crt_static_allows_dylibs { -+ if link_static { -+ cmd.link_staticlib(name, verbatim) -+ } -+ } else { -+ if link_dynamic { -+ cmd.link_dylib(name, verbatim, true); -+ } - } - } - NativeLibKind::Framework { as_needed } => { -@@ -2504,6 +2528,7 @@ fn add_local_native_libraries( - archive_builder_builder: &dyn ArchiveBuilderBuilder, - codegen_results: &CodegenResults, - tmpdir: &Path, -+ link_output_kind: LinkOutputKind, - ) { - if sess.opts.unstable_opts.link_native_libraries { - // User-supplied library search paths (-L on the command line). These are the same paths -@@ -2533,6 +2558,7 @@ fn add_local_native_libraries( - LOCAL_CRATE, - link_static, - link_dynamic, -+ link_output_kind, - ); - } - -@@ -2543,6 +2569,7 @@ fn add_upstream_rust_crates<'a>( - codegen_results: &CodegenResults, - crate_type: CrateType, - tmpdir: &Path, -+ link_output_kind: LinkOutputKind, - ) { - // All of the heavy lifting has previously been accomplished by the - // dependency_format module of the compiler. This is just crawling the -@@ -2620,6 +2647,7 @@ fn add_upstream_rust_crates<'a>( - cnum, - link_static, - link_dynamic, -+ link_output_kind, - ); - } - } -@@ -2630,6 +2658,7 @@ fn add_upstream_native_libraries( - archive_builder_builder: &dyn ArchiveBuilderBuilder, - codegen_results: &CodegenResults, - tmpdir: &Path, -+ link_output_kind: LinkOutputKind, - ) { - let search_path = OnceCell::new(); - for &cnum in &codegen_results.crate_info.used_crates { -@@ -2658,6 +2687,7 @@ fn add_upstream_native_libraries( - cnum, - link_static, - link_dynamic, -+ link_output_kind, - ); - } - } -diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs -index ba4b89c9ea10b..e1915e16e2002 100644 ---- a/compiler/rustc_target/src/spec/mod.rs -+++ b/compiler/rustc_target/src/spec/mod.rs -@@ -596,6 +596,17 @@ impl LinkOutputKind { - _ => return None, - }) - } -+ -+ pub fn can_link_dylib(self) -> bool { -+ match self { -+ LinkOutputKind::StaticNoPicExe | LinkOutputKind::StaticPicExe => false, -+ LinkOutputKind::DynamicNoPicExe -+ | LinkOutputKind::DynamicPicExe -+ | LinkOutputKind::DynamicDylib -+ | LinkOutputKind::StaticDylib -+ | LinkOutputKind::WasiReactorExe => true, -+ } -+ } - } - - impl fmt::Display for LinkOutputKind { diff --git a/extra/rust/patches/lfs64-getrandom.patch b/extra/rust/patches/lfs64-getrandom.patch deleted file mode 100644 index 67d99d3a..00000000 --- a/extra/rust/patches/lfs64-getrandom.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/vendor/getrandom-0.2.8/src/util_libc.rs b/vendor/getrandom-0.2.8/src/util_libc.rs -index d057071..83a3f2b 100644 ---- a/vendor/getrandom-0.2.8/src/util_libc.rs -+++ b/vendor/getrandom-0.2.8/src/util_libc.rs -@@ -135,19 +135,11 @@ impl Weak { - } - } - --cfg_if! { -- if #[cfg(any(target_os = "linux", target_os = "emscripten"))] { -- use libc::open64 as open; -- } else { -- use libc::open; -- } --} -- - // SAFETY: path must be null terminated, FD must be manually closed. - pub unsafe fn open_readonly(path: &str) -> Result { - debug_assert_eq!(path.as_bytes().last(), Some(&0)); - loop { -- let fd = open(path.as_ptr() as *const _, libc::O_RDONLY | libc::O_CLOEXEC); -+ let fd = libc::open(path.as_ptr() as *const _, libc::O_RDONLY | libc::O_CLOEXEC); - if fd >= 0 { - return Ok(fd); - } diff --git a/extra/rust/patches/lfs64-libc.patch b/extra/rust/patches/lfs64-libc.patch deleted file mode 100644 index b459bde4..00000000 --- a/extra/rust/patches/lfs64-libc.patch +++ /dev/null @@ -1,2904 +0,0 @@ -diff --git a/vendor/libc-0.2.138/src/unix/linux_like/linux/mod.rs b/vendor/libc-0.2.138/src/unix/linux_like/linux/mod.rs -index f0a0820..c735dcd 100644 ---- a/vendor/libc-0.2.138/src/unix/linux_like/linux/mod.rs -+++ b/vendor/libc-0.2.138/src/unix/linux_like/linux/mod.rs -@@ -58,11 +58,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, -@@ -625,6 +620,10 @@ s! { - pub flag: *mut ::c_int, - pub val: ::c_int, - } -+ pub struct rlimit64 { -+ pub rlim_cur: rlim64_t, -+ pub rlim_max: rlim64_t, -+ } - } - - s_no_extra_traits! { -@@ -643,14 +642,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], -@@ -738,6 +729,13 @@ s_no_extra_traits! { - #[cfg(not(libc_union))] - pub ifr_ifru: ::sockaddr, - } -+ 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! { -@@ -3869,21 +3867,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, -@@ -4200,12 +4185,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, -@@ -4457,6 +4436,40 @@ extern "C" { - ) -> ::c_int; - } - -+// 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-0.2.138/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/vendor/libc-0.2.138/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs -index 5736246..417dc06 100644 ---- a/vendor/libc-0.2.138/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs -+++ b/vendor/libc-0.2.138/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-0.2.138/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/vendor/libc-0.2.138/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -index f354293..9e9dbf6 100644 ---- a/vendor/libc-0.2.138/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -+++ b/vendor/libc-0.2.138/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-0.2.138/src/unix/linux_like/linux/musl/lfs64.rs b/vendor/libc-0.2.138/src/unix/linux_like/linux/musl/lfs64.rs -new file mode 100644 -index 0000000..e3ede15 ---- /dev/null -+++ b/vendor/libc-0.2.138/src/unix/linux_like/linux/musl/lfs64.rs -@@ -0,0 +1,251 @@ -+#[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.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int { -+ ::fstat(fildes, buf.cast()) -+} -+ -+#[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.cast(), flag) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int { -+ ::fstatfs(fd, buf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int { -+ ::fstatvfs(fd, buf.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[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) -+} -+ -+#[inline] -+pub unsafe extern "C" fn open64( -+ pathname: *const ::c_char, -+ flags: ::c_int, -+ mode: ::mode_t, -+) -> ::c_int { -+ ::open(pathname, flags | ::O_LARGEFILE, mode) -+} -+ -+#[inline] -+pub unsafe extern "C" fn openat64( -+ dirfd: ::c_int, -+ pathname: *const ::c_char, -+ flags: ::c_int, -+ mode: ::mode_t, -+) -> ::c_int { -+ ::openat(dirfd, pathname, flags | ::O_LARGEFILE, mode) -+} -+ -+#[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.cast(), old_limit.cast()) -+} -+ -+#[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).cast() -+} -+ -+#[inline] -+pub unsafe extern "C" fn readdir64_r( -+ dirp: *mut ::DIR, -+ entry: *mut ::dirent64, -+ result: *mut *mut ::dirent64, -+) -> ::c_int { -+ ::readdir_r(dirp, entry.cast(), result.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int { -+ ::stat(pathname, statbuf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int { -+ ::statfs(pathname, buf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int { -+ ::statvfs(path, buf.cast()) -+} -+ -+#[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-0.2.138/src/unix/linux_like/linux/musl/mod.rs b/vendor/libc-0.2.138/src/unix/linux_like/linux/musl/mod.rs -index 2a894a6..251da25 100644 ---- a/vendor/libc-0.2.138/src/unix/linux_like/linux/musl/mod.rs -+++ b/vendor/libc-0.2.138/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, -@@ -709,8 +715,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( -@@ -719,13 +723,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; -@@ -774,6 +771,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-0.2.138/src/unix/linux_like/mod.rs b/vendor/libc-0.2.138/src/unix/linux_like/mod.rs -index 8e738d8..5c12ffd 100644 ---- a/vendor/libc-0.2.138/src/unix/linux_like/mod.rs -+++ b/vendor/libc-0.2.138/src/unix/linux_like/mod.rs -@@ -1645,20 +1645,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, -@@ -1670,43 +1659,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, -@@ -1776,8 +1728,70 @@ extern "C" { - pub fn uname(buf: *mut ::utsname) -> ::c_int; - } - -+// 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 = "ulibc", target_env = "musl")))] { - extern "C" { - pub fn preadv64( - fd: ::c_int, -@@ -1791,6 +1805,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-0.2.139/src/unix/linux_like/linux/mod.rs b/vendor/libc-0.2.139/src/unix/linux_like/linux/mod.rs -index 9658f07..76134a0 100644 ---- a/vendor/libc-0.2.139/src/unix/linux_like/linux/mod.rs -+++ b/vendor/libc-0.2.139/src/unix/linux_like/linux/mod.rs -@@ -58,11 +58,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, -@@ -625,6 +620,10 @@ s! { - pub flag: *mut ::c_int, - pub val: ::c_int, - } -+ pub struct rlimit64 { -+ pub rlim_cur: rlim64_t, -+ pub rlim_max: rlim64_t, -+ } - } - - s_no_extra_traits! { -@@ -643,14 +642,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], -@@ -738,6 +729,13 @@ s_no_extra_traits! { - #[cfg(not(libc_union))] - pub ifr_ifru: ::sockaddr, - } -+ 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! { -@@ -3872,21 +3870,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, -@@ -4203,12 +4188,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, -@@ -4460,6 +4439,40 @@ extern "C" { - ) -> ::c_int; - } - -+// 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-0.2.139/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/vendor/libc-0.2.139/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs -index 5736246..417dc06 100644 ---- a/vendor/libc-0.2.139/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs -+++ b/vendor/libc-0.2.139/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-0.2.139/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/vendor/libc-0.2.139/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -index f354293..9e9dbf6 100644 ---- a/vendor/libc-0.2.139/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -+++ b/vendor/libc-0.2.139/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-0.2.139/src/unix/linux_like/linux/musl/lfs64.rs b/vendor/libc-0.2.139/src/unix/linux_like/linux/musl/lfs64.rs -new file mode 100644 -index 0000000..e3ede15 ---- /dev/null -+++ b/vendor/libc-0.2.139/src/unix/linux_like/linux/musl/lfs64.rs -@@ -0,0 +1,251 @@ -+#[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.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int { -+ ::fstat(fildes, buf.cast()) -+} -+ -+#[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.cast(), flag) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int { -+ ::fstatfs(fd, buf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int { -+ ::fstatvfs(fd, buf.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[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) -+} -+ -+#[inline] -+pub unsafe extern "C" fn open64( -+ pathname: *const ::c_char, -+ flags: ::c_int, -+ mode: ::mode_t, -+) -> ::c_int { -+ ::open(pathname, flags | ::O_LARGEFILE, mode) -+} -+ -+#[inline] -+pub unsafe extern "C" fn openat64( -+ dirfd: ::c_int, -+ pathname: *const ::c_char, -+ flags: ::c_int, -+ mode: ::mode_t, -+) -> ::c_int { -+ ::openat(dirfd, pathname, flags | ::O_LARGEFILE, mode) -+} -+ -+#[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.cast(), old_limit.cast()) -+} -+ -+#[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).cast() -+} -+ -+#[inline] -+pub unsafe extern "C" fn readdir64_r( -+ dirp: *mut ::DIR, -+ entry: *mut ::dirent64, -+ result: *mut *mut ::dirent64, -+) -> ::c_int { -+ ::readdir_r(dirp, entry.cast(), result.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int { -+ ::stat(pathname, statbuf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int { -+ ::statfs(pathname, buf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int { -+ ::statvfs(path, buf.cast()) -+} -+ -+#[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-0.2.139/src/unix/linux_like/linux/musl/mod.rs b/vendor/libc-0.2.139/src/unix/linux_like/linux/musl/mod.rs -index 2a894a6..251da25 100644 ---- a/vendor/libc-0.2.139/src/unix/linux_like/linux/musl/mod.rs -+++ b/vendor/libc-0.2.139/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, -@@ -709,8 +715,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( -@@ -719,13 +723,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; -@@ -774,6 +771,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-0.2.139/src/unix/linux_like/mod.rs b/vendor/libc-0.2.139/src/unix/linux_like/mod.rs -index e2e73b3..8d8f2a2 100644 ---- a/vendor/libc-0.2.139/src/unix/linux_like/mod.rs -+++ b/vendor/libc-0.2.139/src/unix/linux_like/mod.rs -@@ -1653,20 +1653,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, -@@ -1678,43 +1667,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, -@@ -1784,8 +1736,70 @@ extern "C" { - pub fn uname(buf: *mut ::utsname) -> ::c_int; - } - -+// 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 = "ulibc", target_env = "musl")))] { - extern "C" { - pub fn preadv64( - fd: ::c_int, -@@ -1799,6 +1813,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-0.2.140/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/vendor/libc-0.2.140/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs -index 9ce6a9f..bf7a4f5 100644 ---- a/vendor/libc-0.2.140/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs -+++ b/vendor/libc-0.2.140/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-0.2.140/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/vendor/libc-0.2.140/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -index f354293..9e9dbf6 100644 ---- a/vendor/libc-0.2.140/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -+++ b/vendor/libc-0.2.140/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-0.2.140/src/unix/linux_like/linux/musl/lfs64.rs b/vendor/libc-0.2.140/src/unix/linux_like/linux/musl/lfs64.rs -new file mode 100644 -index 0000000..e3ede15 ---- /dev/null -+++ b/vendor/libc-0.2.140/src/unix/linux_like/linux/musl/lfs64.rs -@@ -0,0 +1,251 @@ -+#[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.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int { -+ ::fstat(fildes, buf.cast()) -+} -+ -+#[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.cast(), flag) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int { -+ ::fstatfs(fd, buf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int { -+ ::fstatvfs(fd, buf.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[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) -+} -+ -+#[inline] -+pub unsafe extern "C" fn open64( -+ pathname: *const ::c_char, -+ flags: ::c_int, -+ mode: ::mode_t, -+) -> ::c_int { -+ ::open(pathname, flags | ::O_LARGEFILE, mode) -+} -+ -+#[inline] -+pub unsafe extern "C" fn openat64( -+ dirfd: ::c_int, -+ pathname: *const ::c_char, -+ flags: ::c_int, -+ mode: ::mode_t, -+) -> ::c_int { -+ ::openat(dirfd, pathname, flags | ::O_LARGEFILE, mode) -+} -+ -+#[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.cast(), old_limit.cast()) -+} -+ -+#[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).cast() -+} -+ -+#[inline] -+pub unsafe extern "C" fn readdir64_r( -+ dirp: *mut ::DIR, -+ entry: *mut ::dirent64, -+ result: *mut *mut ::dirent64, -+) -> ::c_int { -+ ::readdir_r(dirp, entry.cast(), result.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int { -+ ::stat(pathname, statbuf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int { -+ ::statfs(pathname, buf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int { -+ ::statvfs(path, buf.cast()) -+} -+ -+#[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-0.2.140/src/unix/linux_like/linux/musl/mod.rs b/vendor/libc-0.2.140/src/unix/linux_like/linux/musl/mod.rs -index 37a8ca2..4c60533 100644 ---- a/vendor/libc-0.2.140/src/unix/linux_like/linux/musl/mod.rs -+++ b/vendor/libc-0.2.140/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-0.2.140/src/unix/linux_like/mod.rs b/vendor/libc-0.2.140/src/unix/linux_like/mod.rs -index db57745..b7a28a2 100644 ---- a/vendor/libc-0.2.140/src/unix/linux_like/mod.rs -+++ b/vendor/libc-0.2.140/src/unix/linux_like/mod.rs -@@ -1673,20 +1673,10 @@ 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, -@@ -1698,43 +1688,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, -@@ -1806,8 +1759,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 = "ulibc", target_env = "musl")))] { - extern "C" { - pub fn preadv64( - fd: ::c_int, -@@ -1821,6 +1836,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-0.2.143/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/vendor/libc-0.2.143/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs -index 9ce6a9f..bf7a4f5 100644 ---- a/vendor/libc-0.2.143/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs -+++ b/vendor/libc-0.2.143/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-0.2.143/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/vendor/libc-0.2.143/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -index f354293..9e9dbf6 100644 ---- a/vendor/libc-0.2.143/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -+++ b/vendor/libc-0.2.143/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-0.2.143/src/unix/linux_like/linux/musl/lfs64.rs b/vendor/libc-0.2.143/src/unix/linux_like/linux/musl/lfs64.rs -new file mode 100644 -index 0000000..e3ede15 ---- /dev/null -+++ b/vendor/libc-0.2.143/src/unix/linux_like/linux/musl/lfs64.rs -@@ -0,0 +1,251 @@ -+#[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.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int { -+ ::fstat(fildes, buf.cast()) -+} -+ -+#[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.cast(), flag) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int { -+ ::fstatfs(fd, buf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int { -+ ::fstatvfs(fd, buf.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[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) -+} -+ -+#[inline] -+pub unsafe extern "C" fn open64( -+ pathname: *const ::c_char, -+ flags: ::c_int, -+ mode: ::mode_t, -+) -> ::c_int { -+ ::open(pathname, flags | ::O_LARGEFILE, mode) -+} -+ -+#[inline] -+pub unsafe extern "C" fn openat64( -+ dirfd: ::c_int, -+ pathname: *const ::c_char, -+ flags: ::c_int, -+ mode: ::mode_t, -+) -> ::c_int { -+ ::openat(dirfd, pathname, flags | ::O_LARGEFILE, mode) -+} -+ -+#[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.cast(), old_limit.cast()) -+} -+ -+#[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).cast() -+} -+ -+#[inline] -+pub unsafe extern "C" fn readdir64_r( -+ dirp: *mut ::DIR, -+ entry: *mut ::dirent64, -+ result: *mut *mut ::dirent64, -+) -> ::c_int { -+ ::readdir_r(dirp, entry.cast(), result.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int { -+ ::stat(pathname, statbuf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int { -+ ::statfs(pathname, buf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int { -+ ::statvfs(path, buf.cast()) -+} -+ -+#[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-0.2.143/src/unix/linux_like/linux/musl/mod.rs b/vendor/libc-0.2.143/src/unix/linux_like/linux/musl/mod.rs -index 37a8ca2..4c60533 100644 ---- a/vendor/libc-0.2.143/src/unix/linux_like/linux/musl/mod.rs -+++ b/vendor/libc-0.2.143/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-0.2.143/src/unix/linux_like/mod.rs b/vendor/libc-0.2.143/src/unix/linux_like/mod.rs -index e08bb7d..bd697c1 100644 ---- a/vendor/libc-0.2.143/src/unix/linux_like/mod.rs -+++ b/vendor/libc-0.2.143/src/unix/linux_like/mod.rs -@@ -1694,20 +1694,10 @@ 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 +1709,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 +1780,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 = "ulibc", target_env = "musl")))] { - extern "C" { - pub fn preadv64( - fd: ::c_int, -@@ -1842,6 +1857,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/linux_like/linux/musl/b32/riscv32/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs -index 9ce6a9f..bf7a4f5 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/b64/riscv64/mod.rs b/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs -index f354293..9e9dbf6 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/lfs64.rs b/vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs -new file mode 100644 -index 0000000..e3ede15 ---- /dev/null -+++ b/vendor/libc/src/unix/linux_like/linux/musl/lfs64.rs -@@ -0,0 +1,251 @@ -+#[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.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int { -+ ::fstat(fildes, buf.cast()) -+} -+ -+#[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.cast(), flag) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int { -+ ::fstatfs(fd, buf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int { -+ ::fstatvfs(fd, buf.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[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) -+} -+ -+#[inline] -+pub unsafe extern "C" fn open64( -+ pathname: *const ::c_char, -+ flags: ::c_int, -+ mode: ::mode_t, -+) -> ::c_int { -+ ::open(pathname, flags | ::O_LARGEFILE, mode) -+} -+ -+#[inline] -+pub unsafe extern "C" fn openat64( -+ dirfd: ::c_int, -+ pathname: *const ::c_char, -+ flags: ::c_int, -+ mode: ::mode_t, -+) -> ::c_int { -+ ::openat(dirfd, pathname, flags | ::O_LARGEFILE, mode) -+} -+ -+#[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.cast(), old_limit.cast()) -+} -+ -+#[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).cast() -+} -+ -+#[inline] -+pub unsafe extern "C" fn readdir64_r( -+ dirp: *mut ::DIR, -+ entry: *mut ::dirent64, -+ result: *mut *mut ::dirent64, -+) -> ::c_int { -+ ::readdir_r(dirp, entry.cast(), result.cast()) -+} -+ -+#[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.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int { -+ ::stat(pathname, statbuf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int { -+ ::statfs(pathname, buf.cast()) -+} -+ -+#[inline] -+pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int { -+ ::statvfs(path, buf.cast()) -+} -+ -+#[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 37a8ca2..4c60533 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 b487da9..4b796a9 100644 ---- a/vendor/libc/src/unix/linux_like/mod.rs -+++ b/vendor/libc/src/unix/linux_like/mod.rs -@@ -1694,20 +1694,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 +1708,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 +1779,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 = "ulibc", target_env = "musl")))] { - extern "C" { - pub fn preadv64( - fd: ::c_int, -@@ -1842,6 +1856,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/extra/rust/patches/lfs64-rust.patch b/extra/rust/patches/lfs64-rust.patch index ceb24c74..d2b2f752 100644 --- a/extra/rust/patches/lfs64-rust.patch +++ b/extra/rust/patches/lfs64-rust.patch @@ -1,27 +1,5 @@ -Patch-Source: https://github.com/rust-lang/rust/pull/106246 --- -From e2355ea7f22219f1fb3919a45e4f07502652ee5c Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 19 May 2023 09:22:21 -0700 -Subject: [PATCH] Do not use LFS64 on linux with musl - -glibc is providing open64 and other lfs64 functions but musl aliases -them to normal equivalents since off_t is always 64-bit on musl, -therefore check for target env along when target OS is linux before -using open64, this is more available. Latest Musl has made these -namespace changes [1] - -[1] https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4 - -Signed-off-by: Khem Raj ---- - library/std/src/os/linux/fs.rs | 9 ++++++++- - library/std/src/sys/unix/fd.rs | 14 ++++++++++---- - library/std/src/sys/unix/fs.rs | 25 +++++++++++++++++++------ - 3 files changed, 37 insertions(+), 11 deletions(-) - diff --git a/library/std/src/os/linux/fs.rs b/library/std/src/os/linux/fs.rs -index 479bbcc17a89e..ab0b2a3eda3f5 100644 +index 479bbcc1..ab0b2a3e 100644 --- a/library/std/src/os/linux/fs.rs +++ b/library/std/src/os/linux/fs.rs @@ -329,7 +329,14 @@ pub trait MetadataExt { @@ -41,10 +19,10 @@ index 479bbcc17a89e..ab0b2a3eda3f5 100644 fn st_dev(&self) -> u64 { self.as_inner().as_inner().st_dev as u64 diff --git a/library/std/src/sys/unix/fd.rs b/library/std/src/sys/unix/fd.rs -index cb630eede6da0..c1e0c05213ac2 100644 +index 85e020ae..7489d5d2 100644 --- a/library/std/src/sys/unix/fd.rs +++ b/library/std/src/sys/unix/fd.rs -@@ -122,9 +122,12 @@ impl FileDesc { +@@ -124,9 +124,12 @@ impl FileDesc { } pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result { @@ -59,7 +37,7 @@ index cb630eede6da0..c1e0c05213ac2 100644 use libc::pread64; unsafe { -@@ -277,9 +280,12 @@ impl FileDesc { +@@ -281,9 +284,12 @@ impl FileDesc { } pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result { @@ -75,10 +53,10 @@ index cb630eede6da0..c1e0c05213ac2 100644 unsafe { diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs -index 09db5b11dbfd3..e31f987c7dc9a 100644 +index fbc7f04c..f6034155 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs -@@ -47,9 +47,13 @@ use libc::{c_int, mode_t}; +@@ -50,9 +50,13 @@ use libc::{c_int, mode_t}; all(target_os = "linux", target_env = "gnu") ))] use libc::c_char; @@ -94,10 +72,10 @@ index 09db5b11dbfd3..e31f987c7dc9a 100644 use libc::fstatat64; #[cfg(any( target_os = "android", -@@ -58,9 +62,10 @@ use libc::fstatat64; - target_os = "redox", +@@ -62,9 +66,10 @@ use libc::fstatat64; target_os = "illumos", target_os = "nto", + target_os = "vita", + target_env = "musl", ))] use libc::readdir as readdir64; @@ -106,7 +84,7 @@ index 09db5b11dbfd3..e31f987c7dc9a 100644 use libc::readdir64; #[cfg(any(target_os = "emscripten", target_os = "l4re"))] use libc::readdir64_r; -@@ -81,7 +86,13 @@ use libc::{ +@@ -86,7 +91,13 @@ use libc::{ dirent as dirent64, fstat as fstat64, fstatat as fstatat64, ftruncate64, lseek64, lstat as lstat64, off64_t, open as open64, stat as stat64, }; @@ -120,7 +98,7 @@ index 09db5b11dbfd3..e31f987c7dc9a 100644 target_os = "linux", target_os = "emscripten", target_os = "l4re", -@@ -91,7 +102,7 @@ use libc::{ +@@ -96,7 +107,7 @@ use libc::{ dirent as dirent64, fstat as fstat64, ftruncate as ftruncate64, lseek as lseek64, lstat as lstat64, off_t as off64_t, open as open64, stat as stat64, }; @@ -129,7 +107,7 @@ index 09db5b11dbfd3..e31f987c7dc9a 100644 use libc::{dirent64, fstat64, ftruncate64, lseek64, lstat64, off64_t, open64, stat64}; pub use crate::sys_common::fs::try_exists; -@@ -278,6 +289,7 @@ unsafe impl Sync for Dir {} +@@ -283,6 +294,7 @@ unsafe impl Sync for Dir {} #[cfg(any( target_os = "android", target_os = "linux", @@ -137,7 +115,7 @@ index 09db5b11dbfd3..e31f987c7dc9a 100644 target_os = "solaris", target_os = "illumos", target_os = "fuchsia", -@@ -312,6 +324,7 @@ struct dirent64_min { +@@ -324,6 +336,7 @@ struct dirent64_min { } #[cfg(not(any( @@ -145,7 +123,7 @@ index 09db5b11dbfd3..e31f987c7dc9a 100644 target_os = "android", target_os = "linux", target_os = "solaris", -@@ -798,7 +811,7 @@ impl DirEntry { +@@ -832,7 +845,7 @@ impl DirEntry { } #[cfg(all( @@ -154,7 +132,7 @@ index 09db5b11dbfd3..e31f987c7dc9a 100644 not(miri) ))] pub fn metadata(&self) -> io::Result { -@@ -822,7 +835,7 @@ impl DirEntry { +@@ -856,7 +869,7 @@ impl DirEntry { } #[cfg(any( diff --git a/extra/rust/sources b/extra/rust/sources index 5f3b8326..ac32a13f 100644 --- a/extra/rust/sources +++ b/extra/rust/sources @@ -1,9 +1,7 @@ -https://static.rust-lang.org/dist/rustc-1.71.0-src.tar.xz -https://static.rust-lang.org/dist/2023-06-01/rust-std-1.70.0-x86_64-unknown-linux-musl.tar.xz?no-extract -https://static.rust-lang.org/dist/2023-06-01/rustc-1.70.0-x86_64-unknown-linux-musl.tar.xz?no-extract -https://static.rust-lang.org/dist/2023-06-01/cargo-1.70.0-x86_64-unknown-linux-musl.tar.xz?no-extract -patches/fix-crt-static.patch +https://static.rust-lang.org/dist/rustc-1.72.0-src.tar.xz +https://static.rust-lang.org/dist/2023-07-13/rust-std-1.71.0-x86_64-unknown-linux-musl.tar.xz?no-extract +https://static.rust-lang.org/dist/2023-07-13/rustc-1.71.0-x86_64-unknown-linux-musl.tar.xz?no-extract +https://static.rust-lang.org/dist/2023-07-13/cargo-1.71.0-x86_64-unknown-linux-musl.tar.xz?no-extract +files/liblfs64.c patches/fix-curl.patch -patches/lfs64-getrandom.patch -patches/lfs64-libc.patch patches/lfs64-rust.patch diff --git a/extra/rust/version b/extra/rust/version index b287b319..7900068f 100644 --- a/extra/rust/version +++ b/extra/rust/version @@ -1 +1 @@ -1.71.0 1 +1.72.0 1