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 #include "nacl_io/kernel_wrap.h" // IRT_EXT is turned on in this header. |
| 8 |
7 // The entire file is wrapped in this #if. We do this so this .cc file can be | 9 // 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. | 10 // compiled, even on a non-bionic build. |
9 | 11 |
10 #if defined(__native_client__) && defined(__BIONIC__) | 12 #if !defined(NACL_IO_IRT_EXT) && defined(__native_client__) && \ |
| 13 defined(__BIONIC__) |
| 14 |
11 #include <alloca.h> | 15 #include <alloca.h> |
12 #include <assert.h> | 16 #include <assert.h> |
13 #include <dirent.h> | 17 #include <dirent.h> |
14 #include <errno.h> | 18 #include <errno.h> |
15 #include <irt_syscalls.h> | 19 #include <irt_syscalls.h> |
16 #include <string.h> | 20 #include <string.h> |
17 #include <sys/stat.h> | 21 #include <sys/stat.h> |
18 #include <sys/time.h> | 22 #include <sys/time.h> |
19 | 23 |
20 #include "nacl_io/kernel_intercept.h" | 24 #include "nacl_io/kernel_intercept.h" |
21 #include "nacl_io/kernel_wrap.h" | |
22 #include "nacl_io/kernel_wrap_real.h" | 25 #include "nacl_io/kernel_wrap_real.h" |
23 #include "nacl_io/osmman.h" | 26 #include "nacl_io/osmman.h" |
24 | 27 |
25 namespace { | 28 namespace { |
26 | 29 |
27 void stat_to_nacl_stat(const struct stat* buf, nacl_abi_stat* nacl_buf) { | 30 void stat_to_nacl_stat(const struct stat* buf, nacl_abi_stat* nacl_buf) { |
28 memset(nacl_buf, 0, sizeof(struct nacl_abi_stat)); | 31 memset(nacl_buf, 0, sizeof(struct nacl_abi_stat)); |
29 nacl_buf->nacl_abi_st_dev = buf->st_dev; | 32 nacl_buf->nacl_abi_st_dev = buf->st_dev; |
30 nacl_buf->nacl_abi_st_ino = buf->st_ino; | 33 nacl_buf->nacl_abi_st_ino = buf->st_ino; |
31 nacl_buf->nacl_abi_st_mode = buf->st_mode; | 34 nacl_buf->nacl_abi_st_mode = buf->st_mode; |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 void kernel_wrap_uninit() { | 522 void kernel_wrap_uninit() { |
520 if (s_wrapped) { | 523 if (s_wrapped) { |
521 EXPAND_SYMBOL_LIST_OPERATION(USE_REAL) | 524 EXPAND_SYMBOL_LIST_OPERATION(USE_REAL) |
522 s_wrapped = false; | 525 s_wrapped = false; |
523 } | 526 } |
524 } | 527 } |
525 | 528 |
526 EXTERN_C_END | 529 EXTERN_C_END |
527 | 530 |
528 #endif // defined(__native_client__) && defined(__BIONIC__) | 531 #endif // defined(__native_client__) && defined(__BIONIC__) |
OLD | NEW |