@@ -750,12 +750,14 @@ pub enum Whence {
750
750
/// Specify an offset relative to the next location in the file greater than or
751
751
/// equal to offset that contains some data. If offset points to
752
752
/// some data, then the file offset is set to offset.
753
+ #[ cfg( any( target_os = "linux" , target_os = "dragonfly" , target_os = "freebsd" ) ) ]
753
754
SeekData ,
754
755
/// Specify an offset relative to the next hole in the file greater than
755
756
/// or equal to offset. If offset points into the middle of a hole, then
756
757
/// the file offset should be set to offset. If there is no hole past offset,
757
758
/// then the file offset should be adjusted to the end of the file (i.e., there
758
759
/// is an implicit hole at the end of any file).
760
+ #[ cfg( any( target_os = "linux" , target_os = "dragonfly" , target_os = "freebsd" ) ) ]
759
761
SeekHole
760
762
}
761
763
@@ -765,8 +767,10 @@ impl Whence {
765
767
& Whence :: SeekSet => libc:: SEEK_SET ,
766
768
& Whence :: SeekCur => libc:: SEEK_CUR ,
767
769
& Whence :: SeekEnd => libc:: SEEK_END ,
768
- & Whence :: SeekData => 3 ,
769
- & Whence :: SeekHole => 4
770
+ #[ cfg( any( target_os = "linux" , target_os = "dragonfly" , target_os = "freebsd" ) ) ]
771
+ & Whence :: SeekData => libc:: SEEK_DATA ,
772
+ #[ cfg( any( target_os = "linux" , target_os = "dragonfly" , target_os = "freebsd" ) ) ]
773
+ & Whence :: SeekHole => libc:: SEEK_HOLE
770
774
}
771
775
}
772
776
0 commit comments