OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_io/filesystem.h" | 5 #include "nacl_io/filesystem.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <stdarg.h> | 9 #include <stdarg.h> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 Error Filesystem::Init(const FsInitArgs& args) { | 33 Error Filesystem::Init(const FsInitArgs& args) { |
34 dev_ = args.dev; | 34 dev_ = args.dev; |
35 ppapi_ = args.ppapi; | 35 ppapi_ = args.ppapi; |
36 return 0; | 36 return 0; |
37 } | 37 } |
38 | 38 |
39 void Filesystem::Destroy() { | 39 void Filesystem::Destroy() { |
40 } | 40 } |
41 | 41 |
| 42 Error Filesystem::Open(const Path& path, |
| 43 int open_flags, |
| 44 ScopedNode* out_node) { |
| 45 return OpenWithMode(path, open_flags, 0777, out_node); |
| 46 } |
| 47 |
42 Error Filesystem::OpenResource(const Path& path, ScopedNode* out_node) { | 48 Error Filesystem::OpenResource(const Path& path, ScopedNode* out_node) { |
43 out_node->reset(NULL); | 49 out_node->reset(NULL); |
44 LOG_TRACE("Can't open resource: %s", path.Join().c_str()); | 50 LOG_TRACE("Can't open resource: %s", path.Join().c_str()); |
45 return EINVAL; | 51 return EINVAL; |
46 } | 52 } |
47 | 53 |
48 void Filesystem::OnNodeCreated(Node* node) { | 54 void Filesystem::OnNodeCreated(Node* node) { |
49 node->stat_.st_ino = inode_pool_.Acquire(); | 55 node->stat_.st_ino = inode_pool_.Acquire(); |
50 node->stat_.st_dev = dev_; | 56 node->stat_.st_dev = dev_; |
51 } | 57 } |
(...skipping 10 matching lines...) Expand all Loading... |
62 | 68 |
63 Error Filesystem::Filesystem_Ioctl(int request, ...) { | 69 Error Filesystem::Filesystem_Ioctl(int request, ...) { |
64 va_list args; | 70 va_list args; |
65 va_start(args, request); | 71 va_start(args, request); |
66 Error error = Filesystem_VIoctl(request, args); | 72 Error error = Filesystem_VIoctl(request, args); |
67 va_end(args); | 73 va_end(args); |
68 return error; | 74 return error; |
69 } | 75 } |
70 | 76 |
71 } // namespace nacl_io | 77 } // namespace nacl_io |
OLD | NEW |