File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -50,16 +50,19 @@ pub fn pwritev<Fd: AsFd, Off: Into<off_t>>(
50
50
iov : & [ IoSlice < ' _ > ] ,
51
51
offset : Off ,
52
52
) -> Result < usize > {
53
+ let offset = offset. into ( ) ;
54
+ // uclibc uses 64-bit offsets for pwritev even if it otherwise uses
55
+ // 32-bit file offsets.
53
56
#[ cfg( target_env = "uclibc" ) ]
54
- let offset = offset as libc:: off64_t ; // uclibc doesn't use off_t
57
+ let offset = offset as libc:: off64_t ;
55
58
56
59
// SAFETY: same as in writev()
57
60
let res = unsafe {
58
61
largefile_fn ! [ pwritev] (
59
62
fd. as_fd ( ) . as_raw_fd ( ) ,
60
63
iov. as_ptr ( ) as * const libc:: iovec ,
61
64
iov. len ( ) as c_int ,
62
- offset. into ( ) ,
65
+ offset,
63
66
)
64
67
} ;
65
68
@@ -80,16 +83,19 @@ pub fn preadv<Fd: AsFd, Off: Into<off_t>>(
80
83
iov : & mut [ IoSliceMut < ' _ > ] ,
81
84
offset : Off ,
82
85
) -> Result < usize > {
86
+ let offset = offset. into ( ) ;
87
+ // uclibc uses 64-bit offsets for preadv even if it otherwise uses
88
+ // 32-bit file offsets.
83
89
#[ cfg( target_env = "uclibc" ) ]
84
- let offset = offset as libc:: off64_t ; // uclibc doesn't use off_t
90
+ let offset = offset as libc:: off64_t ;
85
91
86
92
// SAFETY: same as in readv()
87
93
let res = unsafe {
88
94
largefile_fn ! [ preadv] (
89
95
fd. as_fd ( ) . as_raw_fd ( ) ,
90
96
iov. as_ptr ( ) as * const libc:: iovec ,
91
97
iov. len ( ) as c_int ,
92
- offset. into ( ) ,
98
+ offset,
93
99
)
94
100
} ;
95
101
You can’t perform that action at this time.
0 commit comments