use libc::off_t

This commit is contained in:
WangRunji 2019-04-08 16:22:52 +08:00
parent 5b90d90643
commit f62809096e
4 changed files with 3 additions and 10 deletions

@ -20,12 +20,6 @@ mod socket_file;
mod pipe;
mod sgx_impl;
// TODO: use the type defined in Rust libc.
//
// However, off_t is defined as u64 in the current Rust SGX SDK, which is
// wrong (see issue https://github.com/baidu/rust-sgx-sdk/issues/46)
#[allow(non_camel_case_types)]
pub type off_t = i64;
pub fn do_open(path: &str, flags: u32, mode: u32) -> Result<FileDesc, Error> {
let flags = OpenFlags::from_bits_truncate(flags);

@ -1,4 +1,5 @@
pub use sgx_trts::libc;
pub use sgx_trts::libc::off_t;
pub use sgx_types::*;
use std;
@ -26,8 +27,6 @@ pub use errno::Errno;
pub use errno::Errno::*;
pub use errno::Error;
pub use fs::off_t;
macro_rules! debug_trace {
() => {
println!("> Line = {}, File = {}", line!(), file!())

@ -7,7 +7,7 @@
//! 3. Dispatch the syscall to `do_*` (at this file)
//! 4. Do some memory checks then call `mod::do_*` (at each module)
use fs::{File, SocketFile, off_t, FileDesc, FileRef};
use fs::{File, SocketFile, FileDesc, FileRef};
use prelude::*;
use process::{ChildProcessFilter, FileAction, pid_t, CloneFlags, FutexFlags, FutexOp};
use std::ffi::{CStr, CString};

@ -1,4 +1,4 @@
use fs::{off_t, FileDesc};
use fs::FileDesc;
use prelude::*;
use process::{get_current, Process, ProcessRef};
use std::fmt;