summaryrefslogtreecommitdiff
path: root/src/sys/uio.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/uio.rs')
-rw-r--r--src/sys/uio.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sys/uio.rs b/src/sys/uio.rs
index 3abcde24..52324020 100644
--- a/src/sys/uio.rs
+++ b/src/sys/uio.rs
@@ -31,6 +31,7 @@ pub fn readv(fd: RawFd, iov: &mut [IoVec<&mut [u8]>]) -> Result<usize> {
///
/// See also: [`writev`](fn.writev.html) and [`pwrite`](fn.pwrite.html)
#[cfg(not(target_os = "redox"))]
+#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>],
offset: off_t) -> Result<usize> {
let res = unsafe {
@@ -48,6 +49,7 @@ pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>],
///
/// See also: [`readv`](fn.readv.html) and [`pread`](fn.pread.html)
#[cfg(not(target_os = "redox"))]
+#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn preadv(fd: RawFd, iov: &[IoVec<&mut [u8]>],
offset: off_t) -> Result<usize> {
let res = unsafe {
@@ -92,6 +94,7 @@ pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result<usize>{
/// is used with [`process_vm_readv`](fn.process_vm_readv.html)
/// and [`process_vm_writev`](fn.process_vm_writev.html).
#[cfg(target_os = "linux")]
+#[cfg_attr(docsrs, doc(cfg(all())))]
#[repr(C)]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct RemoteIoVec {
@@ -101,6 +104,9 @@ pub struct RemoteIoVec {
pub len: usize,
}
+feature! {
+#![feature = "process"]
+
/// Write data directly to another process's virtual memory
/// (see [`process_vm_writev`(2)]).
///
@@ -170,6 +176,7 @@ pub fn process_vm_readv(
Errno::result(res).map(|r| r as usize)
}
+}
/// A vector of buffers.
///
@@ -195,7 +202,7 @@ impl<T> IoVec<T> {
}
impl<'a> IoVec<&'a [u8]> {
- #[cfg(target_os = "freebsd")]
+ #[cfg(all(feature = "mount", target_os = "freebsd"))]
pub(crate) fn from_raw_parts(base: *mut c_void, len: usize) -> Self {
IoVec(libc::iovec {
iov_base: base,