OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 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> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 int (*getdents)(int fd, struct dirent *, size_t count, size_t *nread); | 71 int (*getdents)(int fd, struct dirent *, size_t count, size_t *nread); |
72 }; | 72 }; |
73 | 73 |
74 #define NACL_IRT_FILENAME_v0_1 "nacl-irt-filename-0.1" | 74 #define NACL_IRT_FILENAME_v0_1 "nacl-irt-filename-0.1" |
75 struct nacl_irt_filename { | 75 struct nacl_irt_filename { |
76 int (*open)(const char *pathname, int oflag, mode_t cmode, int *newfd); | 76 int (*open)(const char *pathname, int oflag, mode_t cmode, int *newfd); |
77 int (*stat)(const char *pathname, struct stat *); | 77 int (*stat)(const char *pathname, struct stat *); |
78 }; | 78 }; |
79 | 79 |
80 #define NACL_IRT_MEMORY_v0_1 "nacl-irt-memory-0.1" | 80 #define NACL_IRT_MEMORY_v0_1 "nacl-irt-memory-0.1" |
81 struct nacl_irt_memory { | 81 struct nacl_irt_memory_v0_1 { |
82 int (*sysbrk)(void **newbrk); | 82 int (*sysbrk)(void **newbrk); |
83 int (*mmap)(void **addr, size_t len, int prot, int flags, int fd, off_t off); | 83 int (*mmap)(void **addr, size_t len, int prot, int flags, int fd, off_t off); |
84 int (*munmap)(void *addr, size_t len); | 84 int (*munmap)(void *addr, size_t len); |
85 }; | 85 }; |
86 | 86 |
| 87 #define NACL_IRT_MEMORY_v0_2 "nacl-irt-memory-0.2" |
| 88 struct nacl_irt_memory_v0_2 { |
| 89 int (*sysbrk)(void **newbrk); |
| 90 int (*mmap)(void **addr, size_t len, int prot, int flags, int fd, off_t off); |
| 91 int (*munmap)(void *addr, size_t len); |
| 92 int (*mprotect)(void *addr, size_t len, int prot); |
| 93 }; |
| 94 |
87 #define NACL_IRT_DYNCODE_v0_1 "nacl-irt-dyncode-0.1" | 95 #define NACL_IRT_DYNCODE_v0_1 "nacl-irt-dyncode-0.1" |
88 struct nacl_irt_dyncode { | 96 struct nacl_irt_dyncode { |
89 int (*dyncode_create)(void *dest, const void *src, size_t size); | 97 int (*dyncode_create)(void *dest, const void *src, size_t size); |
90 int (*dyncode_modify)(void *dest, const void *src, size_t size); | 98 int (*dyncode_modify)(void *dest, const void *src, size_t size); |
91 int (*dyncode_delete)(void *dest, size_t size); | 99 int (*dyncode_delete)(void *dest, size_t size); |
92 }; | 100 }; |
93 | 101 |
94 #define NACL_IRT_THREAD_v0_1 "nacl-irt-thread-0.1" | 102 #define NACL_IRT_THREAD_v0_1 "nacl-irt-thread-0.1" |
95 struct nacl_irt_thread { | 103 struct nacl_irt_thread { |
96 int (*thread_create)(void *start_user_address, void *stack, void *thread_ptr); | 104 int (*thread_create)(void *start_user_address, void *stack, void *thread_ptr); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 struct nacl_irt_clock { | 160 struct nacl_irt_clock { |
153 int (*getres)(clockid_t clk_id, struct timespec *res); | 161 int (*getres)(clockid_t clk_id, struct timespec *res); |
154 int (*gettime)(clockid_t clk_id, struct timespec *tp); | 162 int (*gettime)(clockid_t clk_id, struct timespec *tp); |
155 }; | 163 }; |
156 | 164 |
157 #if __cplusplus | 165 #if __cplusplus |
158 } | 166 } |
159 #endif | 167 #endif |
160 | 168 |
161 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H */ | 169 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H */ |
OLD | NEW |