use libc::off_t
This commit is contained in:
parent
5b90d90643
commit
f62809096e
@ -20,12 +20,6 @@ mod socket_file;
|
|||||||
mod pipe;
|
mod pipe;
|
||||||
mod sgx_impl;
|
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> {
|
pub fn do_open(path: &str, flags: u32, mode: u32) -> Result<FileDesc, Error> {
|
||||||
let flags = OpenFlags::from_bits_truncate(flags);
|
let flags = OpenFlags::from_bits_truncate(flags);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
pub use sgx_trts::libc;
|
pub use sgx_trts::libc;
|
||||||
|
pub use sgx_trts::libc::off_t;
|
||||||
pub use sgx_types::*;
|
pub use sgx_types::*;
|
||||||
use std;
|
use std;
|
||||||
|
|
||||||
@ -26,8 +27,6 @@ pub use errno::Errno;
|
|||||||
pub use errno::Errno::*;
|
pub use errno::Errno::*;
|
||||||
pub use errno::Error;
|
pub use errno::Error;
|
||||||
|
|
||||||
pub use fs::off_t;
|
|
||||||
|
|
||||||
macro_rules! debug_trace {
|
macro_rules! debug_trace {
|
||||||
() => {
|
() => {
|
||||||
println!("> Line = {}, File = {}", line!(), file!())
|
println!("> Line = {}, File = {}", line!(), file!())
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
//! 3. Dispatch the syscall to `do_*` (at this file)
|
//! 3. Dispatch the syscall to `do_*` (at this file)
|
||||||
//! 4. Do some memory checks then call `mod::do_*` (at each module)
|
//! 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 prelude::*;
|
||||||
use process::{ChildProcessFilter, FileAction, pid_t, CloneFlags, FutexFlags, FutexOp};
|
use process::{ChildProcessFilter, FileAction, pid_t, CloneFlags, FutexFlags, FutexOp};
|
||||||
use std::ffi::{CStr, CString};
|
use std::ffi::{CStr, CString};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use fs::{off_t, FileDesc};
|
use fs::FileDesc;
|
||||||
use prelude::*;
|
use prelude::*;
|
||||||
use process::{get_current, Process, ProcessRef};
|
use process::{get_current, Process, ProcessRef};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
Loading…
Reference in New Issue
Block a user