| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "files/public/c/mojio_unistd.h" | 5 #include "files/c/mojio_unistd.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "files/public/c/lib/directory_wrapper.h" | 10 #include "files/c/lib/directory_wrapper.h" |
| 11 #include "files/public/c/lib/fd_impl.h" | 11 #include "files/c/lib/fd_impl.h" |
| 12 #include "files/public/c/lib/fd_table.h" | 12 #include "files/c/lib/fd_table.h" |
| 13 #include "files/public/c/lib/singletons.h" | 13 #include "files/c/lib/singletons.h" |
| 14 | 14 |
| 15 namespace mojio { | 15 namespace mojio { |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 int ChdirImpl(const char* path) { | 18 int ChdirImpl(const char* path) { |
| 19 DirectoryWrapper* cwd = singletons::GetCurrentWorkingDirectory(); | 19 DirectoryWrapper* cwd = singletons::GetCurrentWorkingDirectory(); |
| 20 if (!cwd) | 20 if (!cwd) |
| 21 return -1; | 21 return -1; |
| 22 | 22 |
| 23 return cwd->Chdir(path) ? 0 : -1; | 23 return cwd->Chdir(path) ? 0 : -1; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 mojio_ssize_t mojio_read(int fd, void* buf, size_t count) { | 103 mojio_ssize_t mojio_read(int fd, void* buf, size_t count) { |
| 104 return mojio::ReadImpl(fd, buf, count); | 104 return mojio::ReadImpl(fd, buf, count); |
| 105 } | 105 } |
| 106 | 106 |
| 107 mojio_ssize_t mojio_write(int fd, const void* buf, size_t count) { | 107 mojio_ssize_t mojio_write(int fd, const void* buf, size_t count) { |
| 108 return mojio::WriteImpl(fd, buf, count); | 108 return mojio::WriteImpl(fd, buf, count); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // extern "C" | 111 } // extern "C" |
| OLD | NEW |