1
1
use crate :: errno:: Errno ;
2
- use crate :: off_t;
3
2
use libc:: { self , c_char, c_int, c_uint, size_t, ssize_t} ;
4
3
use std:: ffi:: OsString ;
5
4
#[ cfg( not( target_os = "redox" ) ) ]
@@ -12,6 +11,17 @@ use crate::{sys::stat::Mode, NixPath, Result};
12
11
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
13
12
use std:: ptr; // For splice and copy_file_range
14
13
14
+ #[ cfg( any(
15
+ target_os = "linux" ,
16
+ target_os = "android" ,
17
+ target_os = "dragonfly" ,
18
+ target_os = "emscripten" ,
19
+ target_os = "fuchsia" ,
20
+ target_os = "wasi" ,
21
+ target_os = "freebsd"
22
+ ) ) ]
23
+ use crate :: off_t;
24
+
15
25
#[ cfg( any(
16
26
target_os = "linux" ,
17
27
target_os = "android" ,
@@ -758,7 +768,7 @@ pub fn fallocate(
758
768
/// the file offset, and the second is the length of the region.
759
769
#[ cfg( any( target_os = "freebsd" ) ) ]
760
770
#[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
761
- pub struct SpacectlRange ( pub libc :: off_t, pub libc :: off_t) ;
771
+ pub struct SpacectlRange ( pub off_t, pub off_t) ;
762
772
763
773
#[ cfg( any( target_os = "freebsd" ) ) ]
764
774
impl SpacectlRange {
@@ -768,12 +778,12 @@ impl SpacectlRange {
768
778
}
769
779
770
780
#[ inline]
771
- pub fn len( & self ) -> libc :: off_t {
781
+ pub fn len( & self ) -> off_t {
772
782
self . 1
773
783
}
774
784
775
785
#[ inline]
776
- pub fn offset( & self ) -> libc :: off_t {
786
+ pub fn offset( & self ) -> off_t {
777
787
self . 0
778
788
}
779
789
}
@@ -868,8 +878,8 @@ pub fn fspacectl(fd: RawFd, range: SpacectlRange) -> Result<SpacectlRange> {
868
878
#[ cfg( target_os = "freebsd" ) ]
869
879
pub fn fspacectl_all(
870
880
fd: RawFd ,
871
- offset: libc :: off_t,
872
- len: libc :: off_t,
881
+ offset: off_t,
882
+ len: off_t,
873
883
) -> Result <( ) > {
874
884
let mut rqsr = libc:: spacectl_range {
875
885
r_offset: offset,
0 commit comments