@@ -15,7 +15,7 @@ use os::unix::prelude::*;
15
15
use ffi:: { CString , CStr , OsString , OsStr } ;
16
16
use fmt;
17
17
use io:: { self , Error , ErrorKind , SeekFrom } ;
18
- use libc:: { self , dirent, c_int, off_t , mode_t} ;
18
+ use libc:: { self , dirent, c_int, mode_t} ;
19
19
use mem;
20
20
use path:: { Path , PathBuf } ;
21
21
use ptr;
@@ -26,10 +26,10 @@ use sys::{cvt, cvt_r};
26
26
use sys_common:: { AsInner , FromInner } ;
27
27
28
28
#[ cfg( target_os = "linux" ) ]
29
- use libc:: { stat64, fstat64, lstat64, off64_t, ftruncate64} ;
29
+ use libc:: { stat64, fstat64, lstat64, off64_t, ftruncate64, lseek64 } ;
30
30
#[ cfg( not( target_os = "linux" ) ) ]
31
31
use libc:: { stat as stat64, fstat as fstat64, lstat as lstat64, off_t as off64_t,
32
- ftruncate as ftruncate64} ;
32
+ ftruncate as ftruncate64, lseek as lseek64 } ;
33
33
34
34
pub struct File ( FileDesc ) ;
35
35
@@ -461,11 +461,11 @@ impl File {
461
461
462
462
pub fn seek ( & self , pos : SeekFrom ) -> io:: Result < u64 > {
463
463
let ( whence, pos) = match pos {
464
- SeekFrom :: Start ( off) => ( libc:: SEEK_SET , off as off_t ) ,
465
- SeekFrom :: End ( off) => ( libc:: SEEK_END , off as off_t ) ,
466
- SeekFrom :: Current ( off) => ( libc:: SEEK_CUR , off as off_t ) ,
464
+ SeekFrom :: Start ( off) => ( libc:: SEEK_SET , off as off64_t ) ,
465
+ SeekFrom :: End ( off) => ( libc:: SEEK_END , off as off64_t ) ,
466
+ SeekFrom :: Current ( off) => ( libc:: SEEK_CUR , off as off64_t ) ,
467
467
} ;
468
- let n = try!( cvt ( unsafe { libc :: lseek ( self . 0 . raw ( ) , pos, whence) } ) ) ;
468
+ let n = try!( cvt ( unsafe { lseek64 ( self . 0 . raw ( ) , pos, whence) } ) ) ;
469
469
Ok ( n as u64 )
470
470
}
471
471
0 commit comments