diff options
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | src/sys/uio.rs | 6 | ||||
-rw-r--r-- | test/sys/test_uio.rs | 4 |
3 files changed, 5 insertions, 6 deletions
@@ -17,7 +17,6 @@ exclude = [ [features] execvpe = [] -preadv_pwritev = [] signalfd = [] [dependencies] diff --git a/src/sys/uio.rs b/src/sys/uio.rs index 5af10930..edca8cb4 100644 --- a/src/sys/uio.rs +++ b/src/sys/uio.rs @@ -18,7 +18,7 @@ pub fn readv(fd: RawFd, iov: &mut [IoVec<&mut [u8]>]) -> Result<usize> { Errno::result(res).map(|r| r as usize) } -#[cfg(feature = "preadv_pwritev")] +#[cfg(target_os = "linux")] pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>], offset: off_t) -> Result<usize> { let res = unsafe { @@ -28,7 +28,7 @@ pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>], Errno::result(res).map(|r| r as usize) } -#[cfg(feature = "preadv_pwritev")] +#[cfg(target_os = "linux")] pub fn preadv(fd: RawFd, iov: &mut [IoVec<&mut [u8]>], offset: off_t) -> Result<usize> { let res = unsafe { @@ -57,7 +57,7 @@ pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result<usize>{ } #[repr(C)] -pub struct IoVec<T>(libc::iovec, PhantomData<T>); +pub struct IoVec<T>(libc::iovec, PhantomData<T>); impl<T> IoVec<T> { #[inline] diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs index 90cda56f..d805b3b3 100644 --- a/test/sys/test_uio.rs +++ b/test/sys/test_uio.rs @@ -129,7 +129,7 @@ fn test_pread() { } #[test] -#[cfg(feature = "preadv_pwritev")] +#[cfg(target_os = "linux")] fn test_pwritev() { use std::io::Read; @@ -159,7 +159,7 @@ fn test_pwritev() { } #[test] -#[cfg(feature = "preadv_pwritev")] +#[cfg(target_os = "linux")] fn test_preadv() { use std::io::Write; |