| 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/passthroughfs/passthrough_fs.h" | 5 #include "nacl_io/passthroughfs/passthrough_fs.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 | 8 |
| 9 #include "nacl_io/kernel_handle.h" | 9 #include "nacl_io/kernel_handle.h" |
| 10 #include "nacl_io/kernel_wrap_real.h" | 10 #include "nacl_io/kernel_wrap_real.h" |
| 11 #include "nacl_io/passthroughfs/real_node.h" | 11 #include "nacl_io/passthroughfs/real_node.h" |
| 12 | 12 |
| 13 namespace nacl_io { | 13 namespace nacl_io { |
| 14 | 14 |
| 15 PassthroughFs::PassthroughFs() { | 15 PassthroughFs::PassthroughFs() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 Error PassthroughFs::Init(const FsInitArgs& args) { | 18 Error PassthroughFs::Init(const FsInitArgs& args) { |
| 19 return Filesystem::Init(args); | 19 return Filesystem::Init(args); |
| 20 } | 20 } |
| 21 | 21 |
| 22 void PassthroughFs::Destroy() { | 22 void PassthroughFs::Destroy() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 Error PassthroughFs::Open(const Path& path, int mode, ScopedNode* out_node) { | 25 Error PassthroughFs::OpenWithMode(const Path& path, int open_flags, |
| 26 mode_t mode, ScopedNode* out_node) { |
| 26 out_node->reset(NULL); | 27 out_node->reset(NULL); |
| 27 int real_fd; | 28 int real_fd; |
| 28 int error = _real_open(path.Join().c_str(), mode, 0666, &real_fd); | 29 int error = _real_open(path.Join().c_str(), open_flags, mode, &real_fd); |
| 29 if (error) | 30 if (error) |
| 30 return error; | 31 return error; |
| 31 | 32 |
| 32 out_node->reset(new RealNode(this, real_fd, true)); | 33 out_node->reset(new RealNode(this, real_fd, true)); |
| 33 return 0; | 34 return 0; |
| 34 } | 35 } |
| 35 | 36 |
| 36 Error PassthroughFs::OpenResource(const Path& path, ScopedNode* out_node) { | 37 Error PassthroughFs::OpenResource(const Path& path, ScopedNode* out_node) { |
| 37 int real_fd; | 38 int real_fd; |
| 38 out_node->reset(NULL); | 39 out_node->reset(NULL); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 61 // Not implemented by NaCl. | 62 // Not implemented by NaCl. |
| 62 return ENOSYS; | 63 return ENOSYS; |
| 63 } | 64 } |
| 64 | 65 |
| 65 Error PassthroughFs::Rename(const Path& path, const Path& newpath) { | 66 Error PassthroughFs::Rename(const Path& path, const Path& newpath) { |
| 66 // Not implemented by NaCl. | 67 // Not implemented by NaCl. |
| 67 return ENOSYS; | 68 return ENOSYS; |
| 68 } | 69 } |
| 69 | 70 |
| 70 } // namespace nacl_io | 71 } // namespace nacl_io |
| OLD | NEW |