Index: src/trusted/sel_universal/reverse_emulate.cc |
diff --git a/src/trusted/sel_universal/reverse_emulate.cc b/src/trusted/sel_universal/reverse_emulate.cc |
index cccf29570179f6f9c2049937bdbe78977afd0009..ad20da94d483eeaea7a328eb9cb61c195798b56b 100644 |
--- a/src/trusted/sel_universal/reverse_emulate.cc |
+++ b/src/trusted/sel_universal/reverse_emulate.cc |
@@ -22,6 +22,7 @@ |
#include "native_client/src/shared/srpc/nacl_srpc.h" |
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
#include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h" |
+#include "native_client/src/trusted/reverse_service/nacl_file_info.h" |
#include "native_client/src/trusted/reverse_service/reverse_service.h" |
#include "native_client/src/trusted/sel_universal/rpc_universal.h" |
#include "native_client/src/trusted/sel_universal/srpc_helper.h" |
@@ -41,7 +42,8 @@ class ReverseEmulate : public nacl::ReverseInterface { |
// Name service use. |
virtual bool EnumerateManifestKeys(std::set<nacl::string>* keys); |
- virtual bool OpenManifestEntry(nacl::string url_key, int32_t* out_desc); |
+ virtual bool OpenManifestEntry(nacl::string url_key, |
+ struct NaClFileInfo* info); |
virtual bool CloseManifestEntry(int32_t desc); |
virtual void ReportCrash(); |
@@ -240,10 +242,10 @@ bool ReverseEmulate::EnumerateManifestKeys(std::set<nacl::string>* keys) { |
} |
bool ReverseEmulate::OpenManifestEntry(nacl::string url_key, |
- int32_t* out_desc) { |
+ struct NaClFileInfo* info) { |
NaClLog(1, "ReverseEmulate::OpenManifestEntry (url_key=%s)\n", |
url_key.c_str()); |
- *out_desc = -1; |
+ info->desc = -1; |
// Find the pathname for the key. |
if (g_key_to_file.find(url_key) == g_key_to_file.end()) { |
NaClLog(1, "ReverseEmulate::OpenManifestEntry: no pathname for key.\n"); |
@@ -252,8 +254,11 @@ bool ReverseEmulate::OpenManifestEntry(nacl::string url_key, |
nacl::string pathname = g_key_to_file[url_key]; |
NaClLog(1, "ReverseEmulate::OpenManifestEntry: pathname is %s.\n", |
pathname.c_str()); |
- *out_desc = OPEN(pathname.c_str(), O_RDONLY); |
- return *out_desc >= 0; |
+ // TODO(ncbray): provide more information so that fast validation caching and |
+ // mmaping can be enabled. |
+ info->desc = OPEN(pathname.c_str(), O_RDONLY); |
+ info->nonce = 0; |
+ return info->desc >= 0; |
} |
bool ReverseEmulate::CloseManifestEntry(int32_t desc) { |