Skip to content

Commit 6de4924

Browse files
committed
Update emscripten functions declarations
1 parent 01008e4 commit 6de4924

File tree

2 files changed

+2
-34
lines changed

2 files changed

+2
-34
lines changed

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)