@@ -9,7 +9,7 @@ use std::os::unix::io::{AsFd, AsRawFd};
9
9
/// Low-level vectored write to a raw file descriptor
10
10
///
11
11
/// See also [writev(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/writev.html)
12
- pub fn writev < Fd : AsFd > ( fd : & Fd , iov : & [ IoSlice < ' _ > ] ) -> Result < usize > {
12
+ pub fn writev < Fd : AsFd > ( fd : Fd , iov : & [ IoSlice < ' _ > ] ) -> Result < usize > {
13
13
// SAFETY: to quote the documentation for `IoSlice`:
14
14
//
15
15
// [IoSlice] is semantically a wrapper around a &[u8], but is
@@ -27,7 +27,7 @@ pub fn writev<Fd: AsFd>(fd: &Fd, iov: &[IoSlice<'_>]) -> Result<usize> {
27
27
/// Low-level vectored read from a raw file descriptor
28
28
///
29
29
/// See also [readv(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/readv.html)
30
- pub fn readv < Fd : AsFd > ( fd : & Fd , iov : & mut [ IoSliceMut < ' _ > ] ) -> Result < usize > {
30
+ pub fn readv < Fd : AsFd > ( fd : Fd , iov : & mut [ IoSliceMut < ' _ > ] ) -> Result < usize > {
31
31
// SAFETY: same as in writev(), IoSliceMut is ABI-compatible with iovec
32
32
let res = unsafe {
33
33
libc:: readv ( fd. as_fd ( ) . as_raw_fd ( ) , iov. as_ptr ( ) as * const libc:: iovec , iov. len ( ) as c_int )
@@ -44,7 +44,7 @@ pub fn readv<Fd: AsFd>(fd: &Fd, iov: &mut [IoSliceMut<'_>]) -> Result<usize> {
44
44
/// See also: [`writev`](fn.writev.html) and [`pwrite`](fn.pwrite.html)
45
45
#[ cfg( not( any( target_os = "redox" , target_os = "haiku" ) ) ) ]
46
46
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
47
- pub fn pwritev < Fd : AsFd > ( fd : & Fd , iov : & [ IoSlice < ' _ > ] , offset : off_t ) -> Result < usize > {
47
+ pub fn pwritev < Fd : AsFd > ( fd : Fd , iov : & [ IoSlice < ' _ > ] , offset : off_t ) -> Result < usize > {
48
48
#[ cfg( target_env = "uclibc" ) ]
49
49
let offset = offset as libc:: off64_t ; // uclibc doesn't use off_t
50
50
@@ -71,7 +71,7 @@ pub fn pwritev<Fd: AsFd>(fd: &Fd, iov: &[IoSlice<'_>], offset: off_t) -> Result<
71
71
#[ cfg( not( any( target_os = "redox" , target_os = "haiku" ) ) ) ]
72
72
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
73
73
pub fn preadv < Fd : AsFd > (
74
- fd : & Fd ,
74
+ fd : Fd ,
75
75
iov : & mut [ IoSliceMut < ' _ > ] ,
76
76
offset : off_t ,
77
77
) -> Result < usize > {
@@ -95,7 +95,7 @@ pub fn preadv<Fd: AsFd>(
95
95
///
96
96
/// See also [pwrite(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html)
97
97
// TODO: move to unistd
98
- pub fn pwrite < Fd : AsFd > ( fd : & Fd , buf : & [ u8 ] , offset : off_t ) -> Result < usize > {
98
+ pub fn pwrite < Fd : AsFd > ( fd : Fd , buf : & [ u8 ] , offset : off_t ) -> Result < usize > {
99
99
let res = unsafe {
100
100
libc:: pwrite (
101
101
fd. as_fd ( ) . as_raw_fd ( ) ,
@@ -112,7 +112,7 @@ pub fn pwrite<Fd: AsFd>(fd: &Fd, buf: &[u8], offset: off_t) -> Result<usize> {
112
112
///
113
113
/// See also [pread(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html)
114
114
// TODO: move to unistd
115
- pub fn pread < Fd : AsFd > ( fd : & Fd , buf : & mut [ u8 ] , offset : off_t ) -> Result < usize > {
115
+ pub fn pread < Fd : AsFd > ( fd : Fd , buf : & mut [ u8 ] , offset : off_t ) -> Result < usize > {
116
116
let res = unsafe {
117
117
libc:: pread (
118
118
fd. as_fd ( ) . as_raw_fd ( ) ,
0 commit comments