Skip to content

Commit

Permalink
Rollup merge of rust-lang#65469 - mati865:libc, r=alexcrichton
Browse files Browse the repository at this point in the history
Update libc to 0.2.64

Passed local tests.

cc potentially interested people: @gnzlbg @tlively
  • Loading branch information
Centril authored Oct 19, 2019
2 parents 109ecb6 + 6de4924 commit 94102ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 36 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1713,9 +1713,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"

[[package]]
name = "libc"
version = "0.2.62"
version = "0.2.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"
checksum = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down
34 changes: 2 additions & 32 deletions src/libstd/sys/unix/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,7 @@ impl FileDesc {
#[cfg(target_os = "android")]
use super::android::cvt_pread64;

#[cfg(target_os = "emscripten")]
unsafe fn cvt_pread64(fd: c_int, buf: *mut c_void, count: usize, offset: i64)
-> io::Result<isize>
{
use crate::convert::TryInto;
use libc::pread64;
// pread64 on emscripten actually takes a 32 bit offset
if let Ok(o) = offset.try_into() {
cvt(pread64(fd, buf, count, o))
} else {
Err(io::Error::new(io::ErrorKind::InvalidInput,
"cannot pread >2GB"))
}
}

#[cfg(not(any(target_os = "android", target_os = "emscripten")))]
#[cfg(not(target_os = "android"))]
unsafe fn cvt_pread64(fd: c_int, buf: *mut c_void, count: usize, offset: i64)
-> io::Result<isize>
{
Expand Down Expand Up @@ -128,22 +113,7 @@ impl FileDesc {
#[cfg(target_os = "android")]
use super::android::cvt_pwrite64;

#[cfg(target_os = "emscripten")]
unsafe fn cvt_pwrite64(fd: c_int, buf: *const c_void, count: usize, offset: i64)
-> io::Result<isize>
{
use crate::convert::TryInto;
use libc::pwrite64;
// pwrite64 on emscripten actually takes a 32 bit offset
if let Ok(o) = offset.try_into() {
cvt(pwrite64(fd, buf, count, o))
} else {
Err(io::Error::new(io::ErrorKind::InvalidInput,
"cannot pwrite >2GB"))
}
}

#[cfg(not(any(target_os = "android", target_os = "emscripten")))]
#[cfg(not(target_os = "android"))]
unsafe fn cvt_pwrite64(fd: c_int, buf: *const c_void, count: usize, offset: i64)
-> io::Result<isize>
{
Expand Down
2 changes: 0 additions & 2 deletions src/libstd/sys/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,6 @@ impl File {
SeekFrom::End(off) => (libc::SEEK_END, off),
SeekFrom::Current(off) => (libc::SEEK_CUR, off),
};
#[cfg(target_os = "emscripten")]
let pos = pos as i32;
let n = cvt(unsafe { lseek64(self.0.raw(), pos, whence) })?;
Ok(n as u64)
}
Expand Down

0 comments on commit 94102ef

Please sign in to comment.