Chromium Code Reviews| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 } | 258 } |
| 259 | 259 |
| 260 int WRAP(munmap)(void* addr, size_t length) { | 260 int WRAP(munmap)(void* addr, size_t length) { |
| 261 // Always let the real munmap run on the address range. It is not an error if | 261 // Always let the real munmap run on the address range. It is not an error if |
| 262 // there are no mapped pages in that range. | 262 // there are no mapped pages in that range. |
| 263 ki_munmap(addr, length); | 263 ki_munmap(addr, length); |
| 264 return REAL(munmap)(addr, length); | 264 return REAL(munmap)(addr, length); |
| 265 } | 265 } |
| 266 | 266 |
| 267 int WRAP(open)(const char* pathname, int oflag, mode_t cmode, int* newfd) { | 267 int WRAP(open)(const char* pathname, int oflag, mode_t cmode, int* newfd) { |
| 268 *newfd = ki_open(pathname, oflag); | 268 *newfd = ki_open(pathname, oflag, cmode); |
|
Sam Clegg
2014/09/11 23:47:08
Just call this mode.. here and below?
bradn
2014/09/12 06:17:03
Done.
| |
| 269 ERRNO_RTN(*newfd); | 269 ERRNO_RTN(*newfd); |
| 270 } | 270 } |
| 271 | 271 |
| 272 int WRAP(open_resource)(const char* file, int* fd) { | 272 int WRAP(open_resource)(const char* file, int* fd) { |
| 273 *fd = ki_open_resource(file); | 273 *fd = ki_open_resource(file); |
| 274 ERRNO_RTN(*fd); | 274 ERRNO_RTN(*fd); |
| 275 } | 275 } |
| 276 | 276 |
| 277 int WRAP(poll)(struct pollfd* fds, nfds_t nfds, int timeout, int* count) { | 277 int WRAP(poll)(struct pollfd* fds, nfds_t nfds, int timeout, int* count) { |
| 278 *count = ki_poll(fds, nfds, timeout); | 278 *count = ki_poll(fds, nfds, timeout); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 521 void kernel_wrap_uninit() { | 521 void kernel_wrap_uninit() { |
| 522 if (s_wrapped) { | 522 if (s_wrapped) { |
| 523 EXPAND_SYMBOL_LIST_OPERATION(USE_REAL) | 523 EXPAND_SYMBOL_LIST_OPERATION(USE_REAL) |
| 524 s_wrapped = false; | 524 s_wrapped = false; |
| 525 } | 525 } |
| 526 } | 526 } |
| 527 | 527 |
| 528 EXTERN_C_END | 528 EXTERN_C_END |
| 529 | 529 |
| 530 #endif // defined(__native_client__) && defined(__BIONIC__) | 530 #endif // defined(__native_client__) && defined(__BIONIC__) |
| OLD | NEW |