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 <errno.h> | 5 #include <errno.h> |
6 | 6 |
7 #include "nacl_io/kernel_intercept.h" | 7 #include "nacl_io/kernel_intercept.h" |
8 #include "nacl_io/kernel_proxy.h" | 8 #include "nacl_io/kernel_proxy.h" |
9 #include "nacl_io/kernel_wrap.h" | 9 #include "nacl_io/kernel_wrap.h" |
10 #include "nacl_io/osmman.h" | 10 #include "nacl_io/osmman.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 int ki_is_initialized() { | 45 int ki_is_initialized() { |
46 return s_kp != NULL; | 46 return s_kp != NULL; |
47 } | 47 } |
48 | 48 |
49 void ki_uninit() { | 49 void ki_uninit() { |
50 kernel_wrap_uninit(); | 50 kernel_wrap_uninit(); |
51 s_kp = NULL; | 51 s_kp = NULL; |
52 } | 52 } |
53 | 53 |
54 | |
55 int ki_chdir(const char* path) { | 54 int ki_chdir(const char* path) { |
56 ON_NOSYS_RETURN(-1); | 55 ON_NOSYS_RETURN(-1); |
57 return s_kp->chdir(path); | 56 return s_kp->chdir(path); |
58 } | 57 } |
59 | 58 |
60 char* ki_getcwd(char* buf, size_t size) { | 59 char* ki_getcwd(char* buf, size_t size) { |
61 // gtest uses getcwd in a static initializer. If we haven't initialized the | 60 // gtest uses getcwd in a static initializer. If we haven't initialized the |
62 // kernel-intercept yet, just return ".". | 61 // kernel-intercept yet, just return ".". |
63 if (!ki_is_initialized()) { | 62 if (!ki_is_initialized()) { |
64 if (size < 2) { | 63 if (size < 2) { |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 326 } |
328 | 327 |
329 int ki_socket(int domain, int type, int protocol) { | 328 int ki_socket(int domain, int type, int protocol) { |
330 return s_kp->socket(domain, type, protocol); | 329 return s_kp->socket(domain, type, protocol); |
331 } | 330 } |
332 | 331 |
333 int ki_socketpair(int domain, int type, int protocol, int* sv) { | 332 int ki_socketpair(int domain, int type, int protocol, int* sv) { |
334 return s_kp->socketpair(domain, type, protocol, sv); | 333 return s_kp->socketpair(domain, type, protocol, sv); |
335 } | 334 } |
336 #endif // PROVIDES_SOCKET_API | 335 #endif // PROVIDES_SOCKET_API |
OLD | NEW |