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

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

Issue 233773002: [NaCl SDK] Fix getcwd for bionic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 if (res < 0) 190 if (res < 0)
191 return errno; 191 return errno;
192 stat_to_nacl_stat(&buf, nacl_buf); 192 stat_to_nacl_stat(&buf, nacl_buf);
193 return 0; 193 return 0;
194 } 194 }
195 195
196 int WRAP(fsync)(int fd) NOTHROW { 196 int WRAP(fsync)(int fd) NOTHROW {
197 return (ki_fsync(fd)) ? errno : 0; 197 return (ki_fsync(fd)) ? errno : 0;
198 } 198 }
199 199
200 char* WRAP(getcwd)(char* buf, size_t size) { 200 int WRAP(getcwd)(char* buf, size_t size) {
201 if (ki_getcwd(buf, size) == NULL) 201 if (ki_getcwd(buf, size) == NULL)
202 return errno; 202 return errno;
203 return 0; 203 return 0;
204 } 204 }
205 205
206 int WRAP(getdents)(int fd, dirent* nacl_buf, size_t nacl_count, size_t *nread) { 206 int WRAP(getdents)(int fd, dirent* nacl_buf, size_t nacl_count, size_t *nread) {
207 int nacl_offset = 0; 207 int nacl_offset = 0;
208 // "buf" contains dirent(s); "nacl_buf" contains nacl_abi_dirent(s). 208 // "buf" contains dirent(s); "nacl_buf" contains nacl_abi_dirent(s).
209 // nacl_abi_dirent(s) are smaller than dirent(s), so nacl_count bytes buffer 209 // nacl_abi_dirent(s) are smaller than dirent(s), so nacl_count bytes buffer
210 // is enough 210 // is enough
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 void kernel_wrap_uninit() { 511 void kernel_wrap_uninit() {
512 if (s_wrapped) { 512 if (s_wrapped) {
513 EXPAND_SYMBOL_LIST_OPERATION(USE_REAL) 513 EXPAND_SYMBOL_LIST_OPERATION(USE_REAL)
514 s_wrapped = false; 514 s_wrapped = false;
515 } 515 }
516 } 516 }
517 517
518 EXTERN_C_END 518 EXTERN_C_END
519 519
520 #endif // defined(__native_client__) && defined(__GLIBC__) 520 #endif // defined(__native_client__) && defined(__GLIBC__)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698