occlum/deps/rust-sgx-sdk.patch
2018-07-01 15:57:41 +08:00

47 lines
1.2 KiB
Diff

diff --git a/sgx_tstd/src/lib.rs b/sgx_tstd/src/lib.rs
index 33ee1f2..7f3dab8 100644
--- a/sgx_tstd/src/lib.rs
+++ b/sgx_tstd/src/lib.rs
@@ -222,6 +222,11 @@ pub mod untrusted;
mod sys_common;
mod sys;
+// @tatetian
+// Export some internals of sys so that libos can use them directly
+pub use sys::fs::libc as libc_fs;
+pub use sys::fd::libc as libc_io;
+
// Private support modules
mod panicking;
mod cpuid;
diff --git a/sgx_tstd/src/sys/fd.rs b/sgx_tstd/src/sys/fd.rs
index 3fa46d9..28daa9b 100644
--- a/sgx_tstd/src/sys/fd.rs
+++ b/sgx_tstd/src/sys/fd.rs
@@ -209,7 +209,9 @@ impl Drop for FileDesc {
}
}
-mod libc {
+// @tatetian
+// Make this public so that the libos can use it directly
+pub mod libc {
use sgx_types::sgx_status_t;
use io;
pub use sgx_trts::libc::*;
diff --git a/sgx_tstd/src/sys/fs.rs b/sgx_tstd/src/sys/fs.rs
index a611f39..cc54c31 100644
--- a/sgx_tstd/src/sys/fs.rs
+++ b/sgx_tstd/src/sys/fs.rs
@@ -455,7 +455,9 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
Ok(ret)
}
-mod libc {
+// @tatetian
+// Make this public so that the libos can use it directly
+pub mod libc {
use sgx_types::sgx_status_t;
use io;
use core::ptr;