use fmt;
-#[cfg(any(target_os = "emscripten",
- all(target_os = "linux", any(target_arch = "aarch64",
+#[cfg(any(all(target_os = "linux", any(target_arch = "aarch64",
target_arch = "arm",
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "arm")),
all(target_os = "fuchsia", target_arch = "aarch64")))]
#[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = u8;
-#[cfg(not(any(target_os = "emscripten",
- all(target_os = "linux", any(target_arch = "aarch64",
+#[cfg(not(any(all(target_os = "linux", any(target_arch = "aarch64",
target_arch = "arm",
target_arch = "powerpc",
target_arch = "powerpc64",
#[cfg(target_os = "android")]
use super::android::cvt_pread64;
- #[cfg(not(target_os = "android"))]
+ #[cfg(target_os = "emscripten")]
unsafe fn cvt_pread64(fd: c_int, buf: *mut c_void, count: usize, offset: i64)
-> io::Result<isize>
{
- #[cfg(any(target_os = "linux", target_os = "emscripten"))]
use libc::pread64;
- #[cfg(not(any(target_os = "linux", target_os = "emscripten")))]
+ cvt(pread64(fd, buf, count, offset as i32))
+ }
+
+ #[cfg(not(any(target_os = "android", target_os = "emscripten")))]
+ unsafe fn cvt_pread64(fd: c_int, buf: *mut c_void, count: usize, offset: i64)
+ -> io::Result<isize>
+ {
+ #[cfg(target_os = "linux")]
+ use libc::pread64;
+ #[cfg(not(target_os = "linux"))]
use libc::pread as pread64;
cvt(pread64(fd, buf, count, offset))
}
#[cfg(target_os = "android")]
use super::android::cvt_pwrite64;
- #[cfg(not(target_os = "android"))]
+ #[cfg(target_os = "emscripten")]
+ unsafe fn cvt_pwrite64(fd: c_int, buf: *const c_void, count: usize, offset: i64)
+ -> io::Result<isize>
+ {
+ use libc::pwrite64;
+ cvt(pwrite64(fd, buf, count, offset as i32))
+ }
+
+ #[cfg(not(any(target_os = "android", target_os = "emscripten")))]
unsafe fn cvt_pwrite64(fd: c_int, buf: *const c_void, count: usize, offset: i64)
-> io::Result<isize>
{
- #[cfg(any(target_os = "linux", target_os = "emscripten"))]
+ #[cfg(target_os = "linux")]
use libc::pwrite64;
- #[cfg(not(any(target_os = "linux", target_os = "emscripten")))]
+ #[cfg(not(target_os = "linux"))]
use libc::pwrite as pwrite64;
cvt(pwrite64(fd, buf, count, offset))
}
use io::{self, Error, ErrorKind};
use libc::{self, c_int, gid_t, pid_t, uid_t};
-use mem;
use ptr;
use sys::cvt;
}
// NaCl has no signal support.
- if cfg!(not(any(target_os = "nacl", target_os = "emscripten"))) {
+ #[cfg(not(any(target_os = "nacl", target_os = "emscripten")))]
+ {
+ use mem;
// Reset signal handling so the child process starts in a
// standardized state. libstd ignores SIGPIPE, and signal-handling
// libraries often set a mask. Child processes inherit ignored