@@ -12,7 +12,7 @@ use nix::errno::Errno;
12
12
#[ cfg( all( unix, not( target_os = "redox" ) ) ) ]
13
13
use nix:: pty:: openpty;
14
14
#[ cfg( unix) ]
15
- use nix:: unistd:: { self , Gid , Pid , Uid } ;
15
+ use nix:: unistd:: { self , Gid , Pid , Uid , Whence } ;
16
16
use num_traits:: cast:: ToPrimitive ;
17
17
18
18
use bitflags:: bitflags;
@@ -1215,6 +1215,9 @@ fn extend_module_platform_specific(vm: &VirtualMachine, module: PyObjectRef) ->
1215
1215
"access" => ctx. new_rustfunc( os_access) ,
1216
1216
"chmod" => ctx. new_rustfunc( os_chmod) ,
1217
1217
"ttyname" => ctx. new_rustfunc( os_ttyname) ,
1218
+ "SEEK_SET" => ctx. new_int( Whence :: SeekSet as i8 ) ,
1219
+ "SEEK_CUR" => ctx. new_int( Whence :: SeekCur as i8 ) ,
1220
+ "SEEK_END" => ctx. new_int( Whence :: SeekEnd as i8 )
1218
1221
} ) ;
1219
1222
1220
1223
#[ cfg( not( target_os = "redox" ) ) ]
@@ -1226,6 +1229,12 @@ fn extend_module_platform_specific(vm: &VirtualMachine, module: PyObjectRef) ->
1226
1229
"openpty" => ctx. new_rustfunc( os_openpty) ,
1227
1230
} ) ;
1228
1231
1232
+ #[ cfg( not( target_os = "macos" ) ) ]
1233
+ extend_module ! ( vm, module, {
1234
+ "SEEK_DATA" => ctx. new_int( Whence :: SeekData as i8 ) ,
1235
+ "SEEK_HOLE" => ctx. new_int( Whence :: SeekHole as i8 )
1236
+ } ) ;
1237
+
1229
1238
module
1230
1239
}
1231
1240
0 commit comments