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 | 6 |
7 | 7 |
8 /* | 8 /* |
9 * NaCl inter-module communication primitives. | 9 * NaCl inter-module communication primitives. |
10 * | 10 * |
11 * This file implements common parts of IMC for "UNIX like systems" (i.e. not | 11 * This file implements common parts of IMC for "UNIX like systems" (i.e. not |
12 * used on Windows). | 12 * used on Windows). |
13 */ | 13 */ |
14 | 14 |
15 #include <assert.h> | 15 #include <assert.h> |
16 #include <ctype.h> | 16 #include <ctype.h> |
17 #include <errno.h> | 17 #include <errno.h> |
18 #include <fcntl.h> | 18 #include <fcntl.h> |
19 #include <limits.h> | 19 #include <limits.h> |
20 #include <stdio.h> | 20 #include <stdio.h> |
21 #include <unistd.h> | 21 #include <unistd.h> |
22 #include <sys/mman.h> | 22 #include <sys/mman.h> |
23 #include <sys/types.h> | 23 #include <sys/types.h> |
| 24 #include "native_client/src/include/nacl_defines.h" |
24 #if NACL_ANDROID | 25 #if NACL_ANDROID |
25 #include <linux/ashmem.h> | 26 #include <linux/ashmem.h> |
26 #endif | 27 #endif |
27 | 28 |
28 #include <algorithm> | 29 #include <algorithm> |
29 | 30 |
30 #include "native_client/src/include/atomic_ops.h" | 31 #include "native_client/src/include/atomic_ops.h" |
31 | 32 |
32 #include "native_client/src/shared/imc/nacl_imc_c.h" | 33 #include "native_client/src/shared/imc/nacl_imc_c.h" |
33 #include "native_client/src/shared/platform/nacl_check.h" | 34 #include "native_client/src/shared/platform/nacl_check.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 198 } |
198 if (flags & NACL_MAP_FIXED) { | 199 if (flags & NACL_MAP_FIXED) { |
199 adjusted |= MAP_FIXED; | 200 adjusted |= MAP_FIXED; |
200 } | 201 } |
201 return mmap(start, length, kPosixProt[prot & 7], adjusted, memory, offset); | 202 return mmap(start, length, kPosixProt[prot & 7], adjusted, memory, offset); |
202 } | 203 } |
203 | 204 |
204 int NaClUnmap(void* start, size_t length) { | 205 int NaClUnmap(void* start, size_t length) { |
205 return munmap(start, length); | 206 return munmap(start, length); |
206 } | 207 } |
OLD | NEW |