| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 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 #ifndef NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H_ | 6 #ifndef NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H_ |
| 7 #define NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H_ | 7 #define NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H_ |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| 11 #include <time.h> | 11 #include <time.h> |
| 12 | 12 |
| 13 struct timeval; | 13 struct timeval; |
| 14 struct timespec; | 14 struct timespec; |
| 15 struct stat; | 15 struct nacl_abi_dirent; |
| 16 struct dirent; | 16 struct nacl_abi_stat; |
| 17 | 17 |
| 18 struct PP_StartFunctions; | 18 struct PP_StartFunctions; |
| 19 struct PP_ThreadFunctions; | 19 struct PP_ThreadFunctions; |
| 20 struct NaClExceptionContext; | 20 struct NaClExceptionContext; |
| 21 struct NaClMemMappingInfo; | 21 struct NaClMemMappingInfo; |
| 22 | 22 |
| 23 #if defined(__cplusplus) | 23 #if defined(__cplusplus) |
| 24 extern "C" { | 24 extern "C" { |
| 25 #endif | 25 #endif |
| 26 | 26 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 */ | 103 */ |
| 104 #define NACL_IRT_FDIO_v0_1 "nacl-irt-fdio-0.1" | 104 #define NACL_IRT_FDIO_v0_1 "nacl-irt-fdio-0.1" |
| 105 #define NACL_IRT_DEV_FDIO_v0_1 "nacl-irt-dev-fdio-0.1" | 105 #define NACL_IRT_DEV_FDIO_v0_1 "nacl-irt-dev-fdio-0.1" |
| 106 struct nacl_irt_fdio { | 106 struct nacl_irt_fdio { |
| 107 int (*close)(int fd); | 107 int (*close)(int fd); |
| 108 int (*dup)(int fd, int *newfd); | 108 int (*dup)(int fd, int *newfd); |
| 109 int (*dup2)(int fd, int newfd); | 109 int (*dup2)(int fd, int newfd); |
| 110 int (*read)(int fd, void *buf, size_t count, size_t *nread); | 110 int (*read)(int fd, void *buf, size_t count, size_t *nread); |
| 111 int (*write)(int fd, const void *buf, size_t count, size_t *nwrote); | 111 int (*write)(int fd, const void *buf, size_t count, size_t *nwrote); |
| 112 int (*seek)(int fd, off_t offset, int whence, off_t *new_offset); | 112 int (*seek)(int fd, off_t offset, int whence, off_t *new_offset); |
| 113 int (*fstat)(int fd, struct stat *); | 113 int (*fstat)(int fd, struct nacl_abi_stat *); |
| 114 int (*getdents)(int fd, struct dirent *, size_t count, size_t *nread); | 114 int (*getdents)(int fd, struct nacl_abi_dirent *, size_t count, size_t *nread)
; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 /* | 117 /* |
| 118 * The "irt-filename" interface provides filename-based filesystem | 118 * The "irt-filename" interface provides filename-based filesystem |
| 119 * operations. In Chromium, this is only useful when | 119 * operations. In Chromium, this is only useful when |
| 120 * NACL_DANGEROUS_ENABLE_FILE_ACCESS is set, which enables an unsafe | 120 * NACL_DANGEROUS_ENABLE_FILE_ACCESS is set, which enables an unsafe |
| 121 * debugging mode. | 121 * debugging mode. |
| 122 * | 122 * |
| 123 * Under PNaCl, this interface is not available. This interface is made | 123 * Under PNaCl, this interface is not available. This interface is made |
| 124 * available to non-PNaCl NaCl apps only for compatibility, because | 124 * available to non-PNaCl NaCl apps only for compatibility, because |
| 125 * existing nexes abort on startup if "irt-filename" is not available. | 125 * existing nexes abort on startup if "irt-filename" is not available. |
| 126 */ | 126 */ |
| 127 #define NACL_IRT_FILENAME_v0_1 "nacl-irt-filename-0.1" | 127 #define NACL_IRT_FILENAME_v0_1 "nacl-irt-filename-0.1" |
| 128 struct nacl_irt_filename { | 128 struct nacl_irt_filename { |
| 129 int (*open)(const char *pathname, int oflag, mode_t cmode, int *newfd); | 129 int (*open)(const char *pathname, int oflag, mode_t cmode, int *newfd); |
| 130 int (*stat)(const char *pathname, struct stat *); | 130 int (*stat)(const char *pathname, struct nacl_abi_stat *); |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 /* | 133 /* |
| 134 * This old version of irt-memory is disabled under PNaCl because it | 134 * This old version of irt-memory is disabled under PNaCl because it |
| 135 * contains sysbrk() (see | 135 * contains sysbrk() (see |
| 136 * https://code.google.com/p/nativeclient/issues/detail?id=3542). | 136 * https://code.google.com/p/nativeclient/issues/detail?id=3542). |
| 137 */ | 137 */ |
| 138 #define NACL_IRT_MEMORY_v0_1 "nacl-irt-memory-0.1" | 138 #define NACL_IRT_MEMORY_v0_1 "nacl-irt-memory-0.1" |
| 139 struct nacl_irt_memory_v0_1 { | 139 struct nacl_irt_memory_v0_1 { |
| 140 /* | 140 /* |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 NaClExceptionHandler *old_handler); | 378 NaClExceptionHandler *old_handler); |
| 379 int (*exception_stack)(void *stack, size_t size); | 379 int (*exception_stack)(void *stack, size_t size); |
| 380 int (*exception_clear_flag)(void); | 380 int (*exception_clear_flag)(void); |
| 381 }; | 381 }; |
| 382 | 382 |
| 383 #if defined(__cplusplus) | 383 #if defined(__cplusplus) |
| 384 } | 384 } |
| 385 #endif | 385 #endif |
| 386 | 386 |
| 387 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H */ | 387 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H */ |
| OLD | NEW |