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

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

Issue 565763002: Plumbing though mode parameter to open, since fusefs can make use of it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 6 years, 3 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 __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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 return 0; 178 return 0;
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 mode, int* newfd) {
189 *newfd = ki_open(pathname, oflag); 189 *newfd = ki_open(pathname, oflag, mode);
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 off_t offset) { 328 off_t offset) {
329 CHECK_REAL(mmap); 329 CHECK_REAL(mmap);
330 return REAL(mmap)(addr, length, prot, flags, fd, offset); 330 return REAL(mmap)(addr, length, prot, flags, fd, offset);
331 } 331 }
332 332
333 int _real_munmap(void* addr, size_t length) { 333 int _real_munmap(void* addr, size_t length) {
334 CHECK_REAL(munmap); 334 CHECK_REAL(munmap);
335 return REAL(munmap)(addr, length); 335 return REAL(munmap)(addr, length);
336 } 336 }
337 337
338 int _real_open(const char* pathname, int oflag, mode_t cmode, int* newfd) { 338 int _real_open(const char* pathname, int oflag, mode_t mode, int* newfd) {
339 CHECK_REAL(open); 339 CHECK_REAL(open);
340 return REAL(open)(pathname, oflag, cmode, newfd); 340 return REAL(open)(pathname, oflag, mode, newfd);
341 } 341 }
342 342
343 int _real_open_resource(const char* file, int* fd) { 343 int _real_open_resource(const char* file, int* fd) {
344 return ENOSYS; 344 return ENOSYS;
345 } 345 }
346 346
347 int _real_read(int fd, void* buf, size_t count, size_t* nread) { 347 int _real_read(int fd, void* buf, size_t count, size_t* nread) {
348 CHECK_REAL(read); 348 CHECK_REAL(read);
349 return REAL(read)(fd, buf, count, nread); 349 return REAL(read)(fd, buf, count, nread);
350 } 350 }
(...skipping 28 matching lines...) Expand all
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__) ...
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698