Skip to content

Commit

Permalink
Enable pwritev and preadv for more operating systems.
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Sep 4, 2021
1 parent 525c073 commit 90609a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
(#[1447](https://github.com/nix-rust/nix/pull/1447))
- Added `TcpRepair`
(#[1503](https://github.com/nix-rust/nix/pull/1503))
- Enabled `pwritev` and `preadv` for more operating systems.
(#[1511](https://github.com/nix-rust/nix/pull/1511))

### Changed

Expand Down
14 changes: 3 additions & 11 deletions src/sys/uio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ pub fn readv(fd: RawFd, iov: &mut [IoVec<&mut [u8]>]) -> Result<usize> {
/// or an error occurs. The file offset is not changed.
///
/// See also: [`writev`](fn.writev.html) and [`pwrite`](fn.pwrite.html)
#[cfg(any(target_os = "dragonfly",
target_os = "freebsd",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd"))]
#[cfg(not(target_os = "redox"))]
pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>],
offset: off_t) -> Result<usize> {
let res = unsafe {
Expand All @@ -51,11 +47,7 @@ pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>],
/// changed.
///
/// See also: [`readv`](fn.readv.html) and [`pread`](fn.pread.html)
#[cfg(any(target_os = "dragonfly",
target_os = "freebsd",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd"))]
#[cfg(not(target_os = "redox"))]
pub fn preadv(fd: RawFd, iov: &[IoVec<&mut [u8]>],
offset: off_t) -> Result<usize> {
let res = unsafe {
Expand Down Expand Up @@ -181,7 +173,7 @@ pub fn process_vm_readv(

/// A vector of buffers.
///
/// Vectored I/O methods like [`pwritev`] and [`preadv`] use this structure for
/// Vectored I/O methods like [`writev`] and [`readv`] use this structure for
/// both reading and writing. Each `IoVec` specifies the base address and
/// length of an area in memory.
#[repr(transparent)]
Expand Down

0 comments on commit 90609a5

Please sign in to comment.