This is an automated email from the ASF dual-hosted git repository.
rduan pushed a commit to branch v2.0.0-preview
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-sgx-sdk.git
The following commit(s) were added to refs/heads/v2.0.0-preview by this push:
new ec443201 Implement Send and Sync for SgxFile
ec443201 is described below
commit ec4432014b02f6007fd8fb7c4ea9bc3e8c96d6ef
Author: sunhe05 <[email protected]>
AuthorDate: Fri Jun 30 10:10:10 2023 +0000
Implement Send and Sync for SgxFile
std::fs::File has the implementaions of those two traits. If SgxFile had
the same implementation, it would be convenient for developers to
replace File with SgxFile where those implementations are needed during
Rust crate porting to SGX enclave.
---
sgx_protected_fs/tfs/src/fs.rs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sgx_protected_fs/tfs/src/fs.rs b/sgx_protected_fs/tfs/src/fs.rs
index 732b8831..bce162af 100644
--- a/sgx_protected_fs/tfs/src/fs.rs
+++ b/sgx_protected_fs/tfs/src/fs.rs
@@ -56,6 +56,9 @@ pub struct SgxFile {
inner: fs_imp::SgxFile,
}
+unsafe impl Send for SgxFile {}
+unsafe impl Sync for SgxFile {}
+
/// Read the entire contents of a file into a bytes vector.
#[cfg(feature = "tfs")]
pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]