@@ -19,7 +19,17 @@ pub fn readv(fd: RawFd, iov: &mut [IoVec<&mut [u8]>]) -> Result<usize> {
19
19
Errno :: result ( res) . map ( |r| r as usize )
20
20
}
21
21
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" ) ) ]
23
33
pub fn pwritev ( fd : RawFd , iov : & [ IoVec < & [ u8 ] > ] ,
24
34
offset : off_t ) -> Result < usize > {
25
35
let res = unsafe {
@@ -29,7 +39,18 @@ pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>],
29
39
Errno :: result ( res) . map ( |r| r as usize )
30
40
}
31
41
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" ) ) ]
33
54
pub fn preadv ( fd : RawFd , iov : & mut [ IoVec < & mut [ u8 ] > ] ,
34
55
offset : off_t ) -> Result < usize > {
35
56
let res = unsafe {
0 commit comments