@@ -152,9 +152,7 @@ impl FileDesc {
152
152
target_os = "freebsd" ,
153
153
target_os = "fuchsia" ,
154
154
target_os = "illumos" ,
155
- target_os = "ios" ,
156
155
target_os = "linux" ,
157
- target_os = "macos" ,
158
156
target_os = "netbsd" ,
159
157
) ) ]
160
158
pub fn read_vectored_at ( & self , bufs : & mut [ IoSliceMut < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
@@ -170,6 +168,7 @@ impl FileDesc {
170
168
}
171
169
172
170
#[ cfg( not( any(
171
+ target_os = "android" ,
173
172
target_os = "emscripten" ,
174
173
target_os = "freebsd" ,
175
174
target_os = "fuchsia" ,
@@ -188,7 +187,7 @@ impl FileDesc {
188
187
//
189
188
// On 32-bit targets, we don't want to deal with weird ABI issues around
190
189
// passing 64-bits parameters to syscalls, so we fallback to the default
191
- // implementation.
190
+ // implementation if `preadv` is not available .
192
191
#[ cfg( all( target_os = "android" , target_pointer_width = "64" ) ) ]
193
192
pub fn read_vectored_at ( & self , bufs : & mut [ IoSliceMut < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
194
193
super :: weak:: syscall! {
@@ -211,7 +210,13 @@ impl FileDesc {
211
210
Ok ( ret as usize )
212
211
}
213
212
214
- #[ cfg( all( target_os = "android" , target_pointer_width = "32" ) ) ]
213
+ // We support old MacOS and iOS versions that do not have `preadv`. There is
214
+ // no `syscall` possible in these platform.
215
+ #[ cfg( any(
216
+ all( target_os = "android" , target_pointer_width = "32" ) ,
217
+ target_os = "ios" ,
218
+ target_os = "macos" ,
219
+ ) ) ]
215
220
pub fn read_vectored_at ( & self , bufs : & mut [ IoSliceMut < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
216
221
super :: weak:: weak!( fn preadv64( libc:: c_int, * const libc:: iovec, libc:: c_int, off64_t) -> isize ) ;
217
222
@@ -286,9 +291,7 @@ impl FileDesc {
286
291
target_os = "freebsd" ,
287
292
target_os = "fuchsia" ,
288
293
target_os = "illumos" ,
289
- target_os = "ios" ,
290
294
target_os = "linux" ,
291
- target_os = "macos" ,
292
295
target_os = "netbsd" ,
293
296
) ) ]
294
297
pub fn write_vectored_at ( & self , bufs : & [ IoSlice < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
@@ -304,6 +307,7 @@ impl FileDesc {
304
307
}
305
308
306
309
#[ cfg( not( any(
310
+ target_os = "android" ,
307
311
target_os = "emscripten" ,
308
312
target_os = "freebsd" ,
309
313
target_os = "fuchsia" ,
@@ -322,7 +326,7 @@ impl FileDesc {
322
326
//
323
327
// On 32-bit targets, we don't want to deal with weird ABI issues around
324
328
// passing 64-bits parameters to syscalls, so we fallback to the default
325
- // implementation.
329
+ // implementation if `pwritev` is not available .
326
330
#[ cfg( all( target_os = "android" , target_pointer_width = "64" ) ) ]
327
331
pub fn write_vectored_at ( & self , bufs : & [ IoSlice < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
328
332
super :: weak:: syscall! {
@@ -345,7 +349,13 @@ impl FileDesc {
345
349
Ok ( ret as usize )
346
350
}
347
351
348
- #[ cfg( all( target_os = "android" , target_pointer_width = "32" ) ) ]
352
+ // We support old MacOS and iOS versions that do not have `pwritev`. There is
353
+ // no `syscall` possible in these platform.
354
+ #[ cfg( any(
355
+ all( target_os = "android" , target_pointer_width = "32" ) ,
356
+ target_os = "ios" ,
357
+ target_os = "macos" ,
358
+ ) ) ]
349
359
pub fn write_vectored_at ( & self , bufs : & [ IoSlice < ' _ > ] , offset : u64 ) -> io:: Result < usize > {
350
360
super :: weak:: weak!( fn pwritev64( libc:: c_int, * const libc:: iovec, libc:: c_int, off64_t) -> isize ) ;
351
361
0 commit comments