@@ -19,7 +19,17 @@ pub fn readv(fd: RawFd, iov: &mut [IoVec<&mut [u8]>]) -> Result<usize> {
1919 Errno :: result ( res) . map ( |r| r as usize )
2020}
2121
22- #[ cfg( target_os = "linux" ) ]
22+ /// Write to `fd` at `offset` from buffers in `iov`.
23+ ///
24+ /// Buffers in `iov` will be written in order until all buffers have been written
25+ /// or an error occurs. The file offset is not changed.
26+ ///
27+ /// See also: [`writev`](fn.writev.html) and [`pwrite`](fn.pwrite.html)
28+ #[ cfg( any( target_os = "dragonfly" ,
29+ target_os = "freebsd" ,
30+ target_os = "linux" ,
31+ target_os = "netbsd" ,
32+ target_os = "openbsd" ) ) ]
2333pub fn pwritev ( fd : RawFd , iov : & [ IoVec < & [ u8 ] > ] ,
2434 offset : off_t ) -> Result < usize > {
2535 let res = unsafe {
@@ -29,7 +39,18 @@ pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>],
2939 Errno :: result ( res) . map ( |r| r as usize )
3040}
3141
32- #[ cfg( target_os = "linux" ) ]
42+ /// Read from `fd` at `offset` filling buffers in `iov`.
43+ ///
44+ /// Buffers in `iov` will be filled in order until all buffers have been filled,
45+ /// no more bytes are available, or an error occurs. The file offset is not
46+ /// changed.
47+ ///
48+ /// See also: [`readv`](fn.readv.html) and [`pread`](fn.pread.html)
49+ #[ cfg( any( target_os = "dragonfly" ,
50+ target_os = "freebsd" ,
51+ target_os = "linux" ,
52+ target_os = "netbsd" ,
53+ target_os = "openbsd" ) ) ]
3354pub fn preadv ( fd : RawFd , iov : & mut [ IoVec < & mut [ u8 ] > ] ,
3455 offset : off_t ) -> Result < usize > {
3556 let res = unsafe {
0 commit comments