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

Unified Diff: native_client_sdk/src/libraries/nacl_io/kernel_proxy.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
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/mount.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
index 2f49395ee019fe05a24c46053c7d6b2dfac6fdd2..ddaf56f8da4de6a02a3bbd8ce4d1b2019c271ce4 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
@@ -558,10 +558,25 @@ int KernelProxy::fchmod(int fd, int mode) {
}
int KernelProxy::access(const char* path, int amode) {
- errno = EINVAL;
- return -1;
+ Path rel;
+
+ Mount* mnt;
+ Error error = AcquireMountAndPath(path, &mnt, &rel);
+ if (error) {
+ errno = error;
+ return -1;
+ }
+
+ error = mnt->Access(rel, amode);
+ ReleaseMount(mnt);
+ if (error) {
+ errno = error;
+ return -1;
+ }
+ return 0;
}
+// TODO(noelallen): Needs implementation.
int KernelProxy::link(const char* oldpath, const char* newpath) {
errno = EINVAL;
return -1;
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/mount.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698