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 __GLIBC__. | 5 #include <sys/types.h> // Include something that will define __GLIBC__. |
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-newlib build. | 8 // compiled, even on a non-newlib build. |
9 #if defined(__native_client__) && !defined(__GLIBC__) && !defined(__BIONIC__) | 9 #if defined(__native_client__) && !defined(__GLIBC__) && !defined(__BIONIC__) |
10 | 10 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 | 180 |
181 int WRAP(munmap)(void* addr, size_t length) { | 181 int WRAP(munmap)(void* addr, size_t length) { |
182 // Always let the real munmap run on the address range. It is not an error if | 182 // Always let the real munmap run on the address range. It is not an error if |
183 // there are no mapped pages in that range. | 183 // there are no mapped pages in that range. |
184 ki_munmap(addr, length); | 184 ki_munmap(addr, length); |
185 return REAL(munmap)(addr, length); | 185 return REAL(munmap)(addr, length); |
186 } | 186 } |
187 | 187 |
188 int WRAP(open)(const char* pathname, int oflag, mode_t cmode, int* newfd) { | 188 int WRAP(open)(const char* pathname, int oflag, mode_t cmode, int* newfd) { |
189 *newfd = ki_open(pathname, oflag); | 189 *newfd = ki_open(pathname, oflag, cmode); |
190 ERRNO_RTN(*newfd); | 190 ERRNO_RTN(*newfd); |
191 } | 191 } |
192 | 192 |
193 int WRAP(stat)(const char* pathname, struct stat* buf) { | 193 int WRAP(stat)(const char* pathname, struct stat* buf) { |
194 ERRNO_RTN(ki_stat(pathname, buf)); | 194 ERRNO_RTN(ki_stat(pathname, buf)); |
195 } | 195 } |
196 | 196 |
197 int WRAP(mkdir)(const char* pathname, mode_t mode) { | 197 int WRAP(mkdir)(const char* pathname, mode_t mode) { |
198 ERRNO_RTN(ki_mkdir(pathname, mode)); | 198 ERRNO_RTN(ki_mkdir(pathname, mode)); |
199 } | 199 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 if (s_wrapped) { | 379 if (s_wrapped) { |
380 LOG_TRACE("kernel_wrap_uninit"); | 380 LOG_TRACE("kernel_wrap_uninit"); |
381 EXPAND_SYMBOL_LIST_OPERATION(USE_REAL) | 381 EXPAND_SYMBOL_LIST_OPERATION(USE_REAL) |
382 s_wrapped = false; | 382 s_wrapped = false; |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
386 EXTERN_C_END | 386 EXTERN_C_END |
387 | 387 |
388 #endif // defined(__native_client__) && !defined(__GLIBC__) ... | 388 #endif // defined(__native_client__) && !defined(__GLIBC__) ... |
OLD | NEW |