Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/kernel_wrap_bionic.cc

Issue 1245663004: [NaCl SDK] Re-land "Added support for NaCl IO to use the IRT Extension API." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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__)
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_wrap.h ('k') | native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698