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

Side by Side Diff: native_client_sdk/src/libraries/nacl_mounts/kernel_proxy.cc

Issue 11592003: Add support for simple run of "main" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace missing stdio Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 #include "nacl_mounts/kernel_proxy.h" 5 #include "nacl_mounts/kernel_proxy.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <pthread.h> 9 #include <pthread.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 ppapi_ = ppapi; 43 ppapi_ = ppapi;
44 cwd_ = "/"; 44 cwd_ = "/";
45 dev_ = 1; 45 dev_ = 1;
46 46
47 factories_["memfs"] = MountMem::Create<MountMem>; 47 factories_["memfs"] = MountMem::Create<MountMem>;
48 factories_["dev"] = MountDev::Create<MountDev>; 48 factories_["dev"] = MountDev::Create<MountDev>;
49 49
50 // Create memory mount at root 50 // Create memory mount at root
51 StringMap_t smap; 51 StringMap_t smap;
52 mounts_["/"] = MountMem::Create<MountMem>(dev_++, smap, ppapi_); 52 mounts_["/"] = MountMem::Create<MountMem>(dev_++, smap, ppapi_);
53 mounts_["/dev"] = MountDev::Create<MountDev>(dev_++, smap, ppapi_);
53 } 54 }
54 55
55 int KernelProxy::open(const char *path, int oflags) { 56 int KernelProxy::open(const char *path, int oflags) {
56 Path rel; 57 Path rel;
57 58
58 Mount* mnt = AcquireMountAndPath(path, &rel); 59 Mount* mnt = AcquireMountAndPath(path, &rel);
59 if (mnt == NULL) return -1; 60 if (mnt == NULL) return -1;
60 61
61 MountNode* node = mnt->Open(rel, oflags); 62 MountNode* node = mnt->Open(rel, oflags);
62 if (node == NULL) { 63 if (node == NULL) {
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 // TODO(noelallen): Needs implementation. 374 // TODO(noelallen): Needs implementation.
374 int KernelProxy::fchmod(int fd, int mode) { 375 int KernelProxy::fchmod(int fd, int mode) {
375 errno = EINVAL; 376 errno = EINVAL;
376 return -1; 377 return -1;
377 } 378 }
378 379
379 int KernelProxy::access(const char* path, int amode) { 380 int KernelProxy::access(const char* path, int amode) {
380 errno = EINVAL; 381 errno = EINVAL;
381 return -1; 382 return -1;
382 } 383 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698