std: use LFS open64 on Linux
This commit is contained in:
parent
8f2d7d956c
commit
c84ab39635
|
@ -26,10 +26,10 @@ use sys::{cvt, cvt_r};
|
||||||
use sys_common::{AsInner, FromInner};
|
use sys_common::{AsInner, FromInner};
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
use libc::{stat64, fstat64, lstat64, off64_t, ftruncate64, lseek64, dirent64, readdir64_r};
|
use libc::{stat64, fstat64, lstat64, off64_t, ftruncate64, lseek64, dirent64, readdir64_r, open64};
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
use libc::{stat as stat64, fstat as fstat64, lstat as lstat64, off_t as off64_t,
|
use libc::{stat as stat64, fstat as fstat64, lstat as lstat64, off_t as off64_t,
|
||||||
ftruncate as ftruncate64, lseek as lseek64, dirent as dirent64};
|
ftruncate as ftruncate64, lseek as lseek64, dirent as dirent64, open as open64};
|
||||||
#[cfg(not(any(target_os = "linux", target_os = "solaris")))]
|
#[cfg(not(any(target_os = "linux", target_os = "solaris")))]
|
||||||
use libc::{readdir_r as readdir64_r};
|
use libc::{readdir_r as readdir64_r};
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ impl File {
|
||||||
try!(opts.get_creation_mode()) |
|
try!(opts.get_creation_mode()) |
|
||||||
(opts.custom_flags as c_int & !libc::O_ACCMODE);
|
(opts.custom_flags as c_int & !libc::O_ACCMODE);
|
||||||
let fd = try!(cvt_r(|| unsafe {
|
let fd = try!(cvt_r(|| unsafe {
|
||||||
libc::open(path.as_ptr(), flags, opts.mode as c_int)
|
open64(path.as_ptr(), flags, opts.mode as c_int)
|
||||||
}));
|
}));
|
||||||
let fd = FileDesc::new(fd);
|
let fd = FileDesc::new(fd);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue