about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorMateusz Mikuła <mati865@gmail.com>2019-10-17 12:09:11 +0200
committerMateusz Mikuła <mati865@gmail.com>2019-10-17 12:09:11 +0200
commit6de4924b6c1ff5a99397ca1a3894c51f085f3e6f (patch)
treee08ffe0bf1e863f75c086ee8f2e2b52374ec658f /src/libstd
parent01008e4cd68a92e585d7f9e718393568c800589e (diff)
downloadrust-6de4924b6c1ff5a99397ca1a3894c51f085f3e6f.tar.gz
rust-6de4924b6c1ff5a99397ca1a3894c51f085f3e6f.zip
Update emscripten functions declarations
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/sys/unix/fd.rs34
-rw-r--r--src/libstd/sys/unix/fs.rs2
2 files changed, 2 insertions, 34 deletions
diff --git a/src/libstd/sys/unix/fd.rs b/src/libstd/sys/unix/fd.rs
index ac43526b50f..ba611a6b7e7 100644
--- a/src/libstd/sys/unix/fd.rs
+++ b/src/libstd/sys/unix/fd.rs
@@ -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>
         {
@@ -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>
         {
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs
index 3b1eb86b84f..fdfc350995d 100644
--- a/src/libstd/sys/unix/fs.rs
+++ b/src/libstd/sys/unix/fs.rs
@@ -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)
     }