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

Side by Side Diff: sysdeps/nacl/irt.h

Issue 12382030: Provide mprotect syscall (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: Remove addr const modifier from mprotect Created 7 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
OLDNEW
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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 struct nacl_irt_resource_open { 155 struct nacl_irt_resource_open {
148 int (*open_resource)(const char *file, int *fd); 156 int (*open_resource)(const char *file, int *fd);
149 }; 157 };
150 158
151 #define NACL_IRT_CLOCK_v0_1 "nacl-irt-clock_get-0.1" 159 #define NACL_IRT_CLOCK_v0_1 "nacl-irt-clock_get-0.1"
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
165 /*
166 * NOTE: This is a 'dev' interface which is NOT stable.
167 * In the future, requests for this interface will fail.
168 */
169 #define NACL_IRT_DEV_MPROTECT_v0_1 "nacl-irt-dev-mprotect-0.1"
Mark Seaborn 2013/03/29 15:48:07 You should remove this
Petr Hosek 2013/03/29 21:02:21 Removed.
170 struct nacl_irt_dev_mprotect {
171 int (*mprotect)(void *addr, size_t len, int prot);
172 };
173
157 #if __cplusplus 174 #if __cplusplus
158 } 175 }
159 #endif 176 #endif
160 177
161 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H */ 178 #endif /* NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_H */
OLDNEW
« no previous file with comments | « elf/Versions ('k') | sysdeps/nacl/irt_syscalls.h » ('j') | sysdeps/nacl/irt_syscalls.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698