| OLD | NEW |
| 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_io/mount_passthrough.h" | 5 #include "nacl_io/mount_passthrough.h" |
| 6 #include <errno.h> | 6 #include <errno.h> |
| 7 #include "nacl_io/kernel_wrap_real.h" | 7 #include "nacl_io/kernel_wrap_real.h" |
| 8 | 8 |
| 9 class MountNodePassthrough : public MountNode { | 9 class MountNodePassthrough : public MountNode { |
| 10 public: | 10 public: |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 MountPassthrough::MountPassthrough() {} | 101 MountPassthrough::MountPassthrough() {} |
| 102 | 102 |
| 103 Error MountPassthrough::Init(int dev, | 103 Error MountPassthrough::Init(int dev, |
| 104 StringMap_t& args, | 104 StringMap_t& args, |
| 105 PepperInterface* ppapi) { | 105 PepperInterface* ppapi) { |
| 106 return Mount::Init(dev, args, ppapi); | 106 return Mount::Init(dev, args, ppapi); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void MountPassthrough::Destroy() {} | 109 void MountPassthrough::Destroy() {} |
| 110 | 110 |
| 111 Error MountPassthrough::Access(const Path& path, int a_mode) { |
| 112 // There is no underlying 'access' syscall in NaCl. It just returns ENOSYS. |
| 113 return ENOSYS; |
| 114 } |
| 115 |
| 111 Error MountPassthrough::Open(const Path& path, int mode, MountNode** out_node) { | 116 Error MountPassthrough::Open(const Path& path, int mode, MountNode** out_node) { |
| 112 *out_node = NULL; | 117 *out_node = NULL; |
| 113 | 118 |
| 114 int real_fd; | 119 int real_fd; |
| 115 int error = _real_open(path.Join().c_str(), mode, 0666, &real_fd); | 120 int error = _real_open(path.Join().c_str(), mode, 0666, &real_fd); |
| 116 if (error) | 121 if (error) |
| 117 return error; | 122 return error; |
| 118 | 123 |
| 119 MountNodePassthrough* node = new MountNodePassthrough(this, real_fd); | 124 MountNodePassthrough* node = new MountNodePassthrough(this, real_fd); |
| 120 *out_node = node; | 125 *out_node = node; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 144 } | 149 } |
| 145 | 150 |
| 146 Error MountPassthrough::Rmdir(const Path& path) { | 151 Error MountPassthrough::Rmdir(const Path& path) { |
| 147 return _real_rmdir(path.Join().c_str()); | 152 return _real_rmdir(path.Join().c_str()); |
| 148 } | 153 } |
| 149 | 154 |
| 150 Error MountPassthrough::Remove(const Path& path) { | 155 Error MountPassthrough::Remove(const Path& path) { |
| 151 // Not implemented by NaCl. | 156 // Not implemented by NaCl. |
| 152 return ENOSYS; | 157 return ENOSYS; |
| 153 } | 158 } |
| OLD | NEW |