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