Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <limits.h> | 10 #include <limits.h> |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 } | 237 } |
| 238 | 238 |
| 239 static int irt_write(int fd, const void *buf, size_t count, size_t *nwrote) { | 239 static int irt_write(int fd, const void *buf, size_t count, size_t *nwrote) { |
| 240 int result = write(fd, buf, count); | 240 int result = write(fd, buf, count); |
| 241 if (result < 0) | 241 if (result < 0) |
| 242 return errno; | 242 return errno; |
| 243 *nwrote = result; | 243 *nwrote = result; |
| 244 return 0; | 244 return 0; |
| 245 } | 245 } |
| 246 | 246 |
| 247 static int irt_seek(int fd, nacl_abi_off_t offset, int whence, | 247 static int irt_seek(int fd, nacl_irt_off_t offset, int whence, |
| 248 nacl_abi_off_t *new_offset) { | 248 nacl_irt_off_t *new_offset) { |
|
Petr Hosek
2015/12/22 17:26:41
This could be potentially landed in a separate CL.
John
2015/12/22 18:12:00
This is only a problem when building the unsandbox
| |
| 249 off_t result = lseek(fd, offset, whence); | 249 off_t result = lseek(fd, offset, whence); |
| 250 if (result < 0) | 250 if (result < 0) |
| 251 return errno; | 251 return errno; |
| 252 *new_offset = result; | 252 *new_offset = result; |
| 253 return 0; | 253 return 0; |
| 254 } | 254 } |
| 255 | 255 |
| 256 static int irt_fstat(int fd, struct stat *st_nacl) { | 256 static int irt_fstat(int fd, struct stat *st_nacl) { |
| 257 struct stat st; | 257 struct stat st; |
| 258 if (fstat(fd, &st) != 0) | 258 if (fstat(fd, &st) != 0) |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 884 | 884 |
| 885 #if defined(DEFINE_MAIN) | 885 #if defined(DEFINE_MAIN) |
| 886 int main(int argc, char **argv, char **environ) { | 886 int main(int argc, char **argv, char **environ) { |
| 887 nacl_irt_nonsfi_allow_dev_interfaces(); | 887 nacl_irt_nonsfi_allow_dev_interfaces(); |
| 888 nacl_entry_func_t entry_func = USER_START; | 888 nacl_entry_func_t entry_func = USER_START; |
| 889 | 889 |
| 890 return nacl_irt_nonsfi_entry(argc, argv, environ, entry_func, | 890 return nacl_irt_nonsfi_entry(argc, argv, environ, entry_func, |
| 891 nacl_irt_query_core); | 891 nacl_irt_query_core); |
| 892 } | 892 } |
| 893 #endif | 893 #endif |
| OLD | NEW |