| 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" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 return nread; | 83 return nread; |
| 84 } | 84 } |
| 85 | 85 |
| 86 virtual Error GetStat(struct stat* stat) { | 86 virtual Error GetStat(struct stat* stat) { |
| 87 int err = _real_fstat(real_fd_, stat); | 87 int err = _real_fstat(real_fd_, stat); |
| 88 if (err) | 88 if (err) |
| 89 return err; | 89 return err; |
| 90 return 0; | 90 return 0; |
| 91 } | 91 } |
| 92 | 92 |
| 93 virtual Error Isatty() { |
| 94 #ifdef __GLIBC__ |
| 95 // isatty is not yet hooked up to the IRT interface under glibc. |
| 96 return ENOTTY; |
| 97 #else |
| 98 int result = 0; |
| 99 int err = _real_isatty(real_fd_, &result); |
| 100 if (err) |
| 101 return err; |
| 102 return 0; |
| 103 #endif |
| 104 } |
| 105 |
| 93 Error MMap(void* addr, | 106 Error MMap(void* addr, |
| 94 size_t length, | 107 size_t length, |
| 95 int prot, | 108 int prot, |
| 96 int flags, | 109 int flags, |
| 97 size_t offset, | 110 size_t offset, |
| 98 void** out_addr) { | 111 void** out_addr) { |
| 99 *out_addr = addr; | 112 *out_addr = addr; |
| 100 int err = _real_mmap(out_addr, length, prot, flags, real_fd_, offset); | 113 int err = _real_mmap(out_addr, length, prot, flags, real_fd_, offset); |
| 101 if (err) | 114 if (err) |
| 102 return err; | 115 return err; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // Not implemented by NaCl. | 174 // Not implemented by NaCl. |
| 162 return ENOSYS; | 175 return ENOSYS; |
| 163 } | 176 } |
| 164 | 177 |
| 165 Error PassthroughFs::Rename(const Path& path, const Path& newpath) { | 178 Error PassthroughFs::Rename(const Path& path, const Path& newpath) { |
| 166 // Not implemented by NaCl. | 179 // Not implemented by NaCl. |
| 167 return ENOSYS; | 180 return ENOSYS; |
| 168 } | 181 } |
| 169 | 182 |
| 170 } // namespace nacl_io | 183 } // namespace nacl_io |
| OLD | NEW |