Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: native_client_sdk/src/libraries/nacl_io/mount_dev.cc

Issue 15800004: [NaCl SDK] nacl_io: Added support for access() syscall. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to HEAD. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_io/mount_dev.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_dev.cc b/native_client_sdk/src/libraries/nacl_io/mount_dev.cc
index 11893ea09e8ff985c82bd569b12f5731b1132ac6..a7e507af5f3b7927e73e5dbcfa1c408478d78ae6 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_dev.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_dev.cc
@@ -9,6 +9,7 @@
#include <errno.h>
#include <fcntl.h>
#include <string.h>
+#include <unistd.h>
#include "nacl_io/kernel_wrap_real.h"
#include "nacl_io/mount_dev.h"
#include "nacl_io/mount_node.h"
@@ -269,6 +270,22 @@ Error UrandomNode::Write(size_t offs,
} // namespace
+Error MountDev::Access(const Path& path, int a_mode) {
+ MountNode* node = NULL;
+
+ AutoLock lock(&lock_);
+
+ int error = root_->FindChild(path.Join(), &node);
+ if (error)
+ return error;
+
+ // Don't allow execute access.
+ if (a_mode & X_OK)
+ return EACCES;
+
+ return 0;
+}
+
Error MountDev::Open(const Path& path, int mode, MountNode** out_node) {
*out_node = NULL;
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/mount_dev.h ('k') | native_client_sdk/src/libraries/nacl_io/mount_html5fs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698