Skip to content

Commit 85b9696

Browse files
committed
Remove preadv_pwritev feature in favor of conditional include
1 parent a8614ea commit 85b9696

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ exclude = [
1717

1818
[features]
1919
execvpe = []
20-
preadv_pwritev = []
2120
signalfd = []
2221

2322
[dependencies]

src/sys/uio.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn readv(fd: RawFd, iov: &mut [IoVec<&mut [u8]>]) -> Result<usize> {
1818
Errno::result(res).map(|r| r as usize)
1919
}
2020

21-
#[cfg(feature = "preadv_pwritev")]
21+
#[cfg(target_os = "linux")]
2222
pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>],
2323
offset: off_t) -> Result<usize> {
2424
let res = unsafe {
@@ -28,7 +28,7 @@ pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>],
2828
Errno::result(res).map(|r| r as usize)
2929
}
3030

31-
#[cfg(feature = "preadv_pwritev")]
31+
#[cfg(target_os = "linux")]
3232
pub fn preadv(fd: RawFd, iov: &mut [IoVec<&mut [u8]>],
3333
offset: off_t) -> Result<usize> {
3434
let res = unsafe {
@@ -57,7 +57,7 @@ pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result<usize>{
5757
}
5858

5959
#[repr(C)]
60-
pub struct IoVec<T>(libc::iovec, PhantomData<T>);
60+
pub struct IoVec<T>(libc::iovec, PhantomData<T>);
6161

6262
impl<T> IoVec<T> {
6363
#[inline]

test/sys/test_uio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn test_pread() {
129129
}
130130

131131
#[test]
132-
#[cfg(feature = "preadv_pwritev")]
132+
#[cfg(target_os = "linux")]
133133
fn test_pwritev() {
134134
use std::io::Read;
135135

@@ -159,7 +159,7 @@ fn test_pwritev() {
159159
}
160160

161161
#[test]
162-
#[cfg(feature = "preadv_pwritev")]
162+
#[cfg(target_os = "linux")]
163163
fn test_preadv() {
164164
use std::io::Write;
165165

0 commit comments

Comments
 (0)