Skip to content

Commit 94102ef

Browse files
authored
Rollup merge of rust-lang#65469 - mati865:libc, r=alexcrichton
Update libc to 0.2.64 Passed local tests. cc potentially interested people: @gnzlbg @tlively
2 parents 109ecb6 + 6de4924 commit 94102ef

File tree

3 files changed

+4
-36
lines changed

3 files changed

+4
-36
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1713,9 +1713,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
17131713

17141714
[[package]]
17151715
name = "libc"
1716-
version = "0.2.62"
1716+
version = "0.2.64"
17171717
source = "registry+https://github.com/rust-lang/crates.io-index"
1718-
checksum = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"
1718+
checksum = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c"
17191719
dependencies = [
17201720
"rustc-std-workspace-core",
17211721
]

src/libstd/sys/unix/fd.rs

+2-32
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,7 @@ impl FileDesc {
7171
#[cfg(target_os = "android")]
7272
use super::android::cvt_pread64;
7373

74-
#[cfg(target_os = "emscripten")]
75-
unsafe fn cvt_pread64(fd: c_int, buf: *mut c_void, count: usize, offset: i64)
76-
-> io::Result<isize>
77-
{
78-
use crate::convert::TryInto;
79-
use libc::pread64;
80-
// pread64 on emscripten actually takes a 32 bit offset
81-
if let Ok(o) = offset.try_into() {
82-
cvt(pread64(fd, buf, count, o))
83-
} else {
84-
Err(io::Error::new(io::ErrorKind::InvalidInput,
85-
"cannot pread >2GB"))
86-
}
87-
}
88-
89-
#[cfg(not(any(target_os = "android", target_os = "emscripten")))]
74+
#[cfg(not(target_os = "android"))]
9075
unsafe fn cvt_pread64(fd: c_int, buf: *mut c_void, count: usize, offset: i64)
9176
-> io::Result<isize>
9277
{
@@ -128,22 +113,7 @@ impl FileDesc {
128113
#[cfg(target_os = "android")]
129114
use super::android::cvt_pwrite64;
130115

131-
#[cfg(target_os = "emscripten")]
132-
unsafe fn cvt_pwrite64(fd: c_int, buf: *const c_void, count: usize, offset: i64)
133-
-> io::Result<isize>
134-
{
135-
use crate::convert::TryInto;
136-
use libc::pwrite64;
137-
// pwrite64 on emscripten actually takes a 32 bit offset
138-
if let Ok(o) = offset.try_into() {
139-
cvt(pwrite64(fd, buf, count, o))
140-
} else {
141-
Err(io::Error::new(io::ErrorKind::InvalidInput,
142-
"cannot pwrite >2GB"))
143-
}
144-
}
145-
146-
#[cfg(not(any(target_os = "android", target_os = "emscripten")))]
116+
#[cfg(not(target_os = "android"))]
147117
unsafe fn cvt_pwrite64(fd: c_int, buf: *const c_void, count: usize, offset: i64)
148118
-> io::Result<isize>
149119
{

src/libstd/sys/unix/fs.rs

-2
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,6 @@ impl File {
602602
SeekFrom::End(off) => (libc::SEEK_END, off),
603603
SeekFrom::Current(off) => (libc::SEEK_CUR, off),
604604
};
605-
#[cfg(target_os = "emscripten")]
606-
let pos = pos as i32;
607605
let n = cvt(unsafe { lseek64(self.0.raw(), pos, whence) })?;
608606
Ok(n as u64)
609607
}

0 commit comments

Comments
 (0)