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 <sys/types.h> // Include something that will define __BIONIC__. | 5 #include <sys/types.h> // Include something that will define __BIONIC__. |
6 | 6 |
7 // The entire file is wrapped in this #if. We do this so this .cc file can be | 7 // The entire file is wrapped in this #if. We do this so this .cc file can be |
8 // compiled, even on a non-bionic build. | 8 // compiled, even on a non-bionic build. |
9 | 9 |
10 #if defined(__native_client__) && defined(__BIONIC__) | 10 #if defined(__native_client__) && defined(__BIONIC__) |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 if (res < 0) | 190 if (res < 0) |
191 return errno; | 191 return errno; |
192 stat_to_nacl_stat(&buf, nacl_buf); | 192 stat_to_nacl_stat(&buf, nacl_buf); |
193 return 0; | 193 return 0; |
194 } | 194 } |
195 | 195 |
196 int WRAP(fsync)(int fd) NOTHROW { | 196 int WRAP(fsync)(int fd) NOTHROW { |
197 return (ki_fsync(fd)) ? errno : 0; | 197 return (ki_fsync(fd)) ? errno : 0; |
198 } | 198 } |
199 | 199 |
200 char* WRAP(getcwd)(char* buf, size_t size) { | 200 int WRAP(getcwd)(char* buf, size_t size) { |
201 if (ki_getcwd(buf, size) == NULL) | 201 if (ki_getcwd(buf, size) == NULL) |
202 return errno; | 202 return errno; |
203 return 0; | 203 return 0; |
204 } | 204 } |
205 | 205 |
206 int WRAP(getdents)(int fd, dirent* nacl_buf, size_t nacl_count, size_t *nread) { | 206 int WRAP(getdents)(int fd, dirent* nacl_buf, size_t nacl_count, size_t *nread) { |
207 int nacl_offset = 0; | 207 int nacl_offset = 0; |
208 // "buf" contains dirent(s); "nacl_buf" contains nacl_abi_dirent(s). | 208 // "buf" contains dirent(s); "nacl_buf" contains nacl_abi_dirent(s). |
209 // nacl_abi_dirent(s) are smaller than dirent(s), so nacl_count bytes buffer | 209 // nacl_abi_dirent(s) are smaller than dirent(s), so nacl_count bytes buffer |
210 // is enough | 210 // is enough |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 void kernel_wrap_uninit() { | 511 void kernel_wrap_uninit() { |
512 if (s_wrapped) { | 512 if (s_wrapped) { |
513 EXPAND_SYMBOL_LIST_OPERATION(USE_REAL) | 513 EXPAND_SYMBOL_LIST_OPERATION(USE_REAL) |
514 s_wrapped = false; | 514 s_wrapped = false; |
515 } | 515 } |
516 } | 516 } |
517 | 517 |
518 EXTERN_C_END | 518 EXTERN_C_END |
519 | 519 |
520 #endif // defined(__native_client__) && defined(__GLIBC__) | 520 #endif // defined(__native_client__) && defined(__GLIBC__) |
OLD | NEW |