diff options
author | Bryant Mairs <bryant@mai.rs> | 2017-07-16 21:23:55 -0700 |
---|---|---|
committer | Bryant Mairs <bryant@mai.rs> | 2017-07-17 21:52:37 -0700 |
commit | 79ad5fa487d3d746aa3d03dc70bb133b96053d40 (patch) | |
tree | 155df135c088f84828a74ca81c689e4afb43c3c1 | |
parent | c1ffefa56aaeef189e075dc14774e7f518b10b67 (diff) | |
download | nix-79ad5fa487d3d746aa3d03dc70bb133b96053d40.zip |
Remove preadv_pwritev feature in favor of conditional include
-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; |