| 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 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "native_client/src/include/nacl_compiler_annotations.h" | 9 #include "native_client/src/include/nacl_compiler_annotations.h" |
| 10 #include "native_client/src/include/nacl_macros.h" | 10 #include "native_client/src/include/nacl_macros.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 static int list_mappings_filter(void) { | 33 static int list_mappings_filter(void) { |
| 34 static int nacl_list_mappings_enabled = -1; | 34 static int nacl_list_mappings_enabled = -1; |
| 35 if (NACL_UNLIKELY(-1 == nacl_list_mappings_enabled)) { | 35 if (NACL_UNLIKELY(-1 == nacl_list_mappings_enabled)) { |
| 36 NACL_SYSCALL(sysconf)(NACL_ABI__SC_NACL_LIST_MAPPINGS_ENABLED, | 36 NACL_SYSCALL(sysconf)(NACL_ABI__SC_NACL_LIST_MAPPINGS_ENABLED, |
| 37 &nacl_list_mappings_enabled); | 37 &nacl_list_mappings_enabled); |
| 38 } | 38 } |
| 39 return nacl_list_mappings_enabled; | 39 return nacl_list_mappings_enabled; |
| 40 } | 40 } |
| 41 | 41 |
| 42 static const struct nacl_interface_table irt_interfaces[] = { | 42 static const struct nacl_interface_table irt_interfaces[] = { |
| 43 { NACL_IRT_INSTANCE_v0_1, &nacl_irt_instance, sizeof(nacl_irt_instance), |
| 44 NULL }, |
| 43 { NACL_IRT_BASIC_v0_1, &nacl_irt_basic, sizeof(nacl_irt_basic), NULL }, | 45 { NACL_IRT_BASIC_v0_1, &nacl_irt_basic, sizeof(nacl_irt_basic), NULL }, |
| 44 { NACL_IRT_FDIO_v0_1, &nacl_irt_fdio, sizeof(nacl_irt_fdio), NULL }, | 46 { NACL_IRT_FDIO_v0_1, &nacl_irt_fdio, sizeof(nacl_irt_fdio), NULL }, |
| 45 { NACL_IRT_DEV_FDIO_v0_1, &nacl_irt_fdio, sizeof(nacl_irt_fdio), NULL }, | 47 { NACL_IRT_DEV_FDIO_v0_1, &nacl_irt_fdio, sizeof(nacl_irt_fdio), NULL }, |
| 46 { NACL_IRT_FILENAME_v0_1, &nacl_irt_filename, sizeof(nacl_irt_filename), | 48 { NACL_IRT_FILENAME_v0_1, &nacl_irt_filename, sizeof(nacl_irt_filename), |
| 47 NULL }, | 49 NULL }, |
| 48 { NACL_IRT_DEV_FILENAME_v0_2, &nacl_irt_dev_filename, | 50 { NACL_IRT_DEV_FILENAME_v0_2, &nacl_irt_dev_filename, |
| 49 sizeof(nacl_irt_dev_filename), file_access_filter }, | 51 sizeof(nacl_irt_dev_filename), file_access_filter }, |
| 50 { NACL_IRT_MEMORY_v0_1, &nacl_irt_memory_v0_1, sizeof(nacl_irt_memory_v0_1), | 52 { NACL_IRT_MEMORY_v0_1, &nacl_irt_memory_v0_1, sizeof(nacl_irt_memory_v0_1), |
| 51 NULL }, | 53 NULL }, |
| 52 { NACL_IRT_MEMORY_v0_2, &nacl_irt_memory_v0_2, sizeof(nacl_irt_memory_v0_2), | 54 { NACL_IRT_MEMORY_v0_2, &nacl_irt_memory_v0_2, sizeof(nacl_irt_memory_v0_2), |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 if (size <= tablesize) { | 89 if (size <= tablesize) { |
| 88 memcpy(table, irt_interfaces[i].table, size); | 90 memcpy(table, irt_interfaces[i].table, size); |
| 89 return size; | 91 return size; |
| 90 } | 92 } |
| 91 } | 93 } |
| 92 break; | 94 break; |
| 93 } | 95 } |
| 94 } | 96 } |
| 95 return 0; | 97 return 0; |
| 96 } | 98 } |
| OLD | NEW |