| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2014 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_macros.h" | 9 #include "native_client/src/include/nacl_macros.h" |
| 10 #include "native_client/src/untrusted/irt/irt_dev.h" | 10 #include "native_client/src/untrusted/irt/irt_dev.h" |
| 11 #include "native_client/src/untrusted/irt/irt_extension.h" | 11 #include "native_client/src/untrusted/irt/irt_extension.h" |
| 12 #include "native_client/src/untrusted/nacl/nacl_irt.h" | 12 #include "native_client/src/untrusted/nacl/nacl_irt.h" |
| 13 | 13 |
| 14 /* | 14 /* |
| 15 * The declarations here are used as references for nacl_interface_ext_supply() | 15 * The declarations here are used as references for nacl_interface_ext_supply() |
| 16 * to store the interface table pointers into. They should all be declared as | 16 * to store the interface table pointers into. They should all be declared as |
| 17 * __attribute__((weak)) so that the references to the pointers will be NULL | 17 * __attribute__((weak)) so that the references to the pointers will be NULL |
| 18 * if the user is has not linked in the definition. This makes it so we don't | 18 * if the user is has not linked in the definition. This makes it so we don't |
| 19 * link in extra definitions that are not utilized. | 19 * link in extra definitions that are not utilized. |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 /* Declarations are listed in the same order as in irt.h. */ | 22 /* Declarations are listed in the same order as in irt.h. */ |
| 23 extern struct nacl_irt_basic __libnacl_irt_basic __attribute__((weak)); | 23 extern struct nacl_irt_basic __libnacl_irt_basic __attribute__((weak)); |
| 24 extern struct nacl_irt_fdio __libnacl_irt_fdio __attribute__((weak)); | 24 extern struct nacl_irt_fdio __libnacl_irt_fdio __attribute__((weak)); |
| 25 extern struct nacl_irt_memory __libnacl_irt_memory __attribute__((weak)); | 25 extern struct nacl_irt_memory __libnacl_irt_memory __attribute__((weak)); |
| 26 extern struct nacl_irt_thread __libnacl_irt_thread __attribute__((weak)); | 26 extern struct nacl_irt_thread_v0_2 __libnacl_irt_thread __attribute__((weak)); |
| 27 extern struct nacl_irt_futex __libnacl_irt_futex __attribute__((weak)); | 27 extern struct nacl_irt_futex __libnacl_irt_futex __attribute__((weak)); |
| 28 extern struct nacl_irt_clock __libnacl_irt_clock __attribute__((weak)); | 28 extern struct nacl_irt_clock __libnacl_irt_clock __attribute__((weak)); |
| 29 | 29 |
| 30 /* Declarations are listed in the same order as in irt_dev.h. */ | 30 /* Declarations are listed in the same order as in irt_dev.h. */ |
| 31 extern struct nacl_irt_dev_fdio __libnacl_irt_dev_fdio __attribute__((weak)); | 31 extern struct nacl_irt_dev_fdio __libnacl_irt_dev_fdio __attribute__((weak)); |
| 32 extern struct nacl_irt_dev_filename __libnacl_irt_dev_filename | 32 extern struct nacl_irt_dev_filename __libnacl_irt_dev_filename |
| 33 __attribute__((weak)); | 33 __attribute__((weak)); |
| 34 extern struct nacl_irt_tls __libnacl_irt_tls __attribute__((weak)); | 34 extern struct nacl_irt_tls __libnacl_irt_tls __attribute__((weak)); |
| 35 extern struct nacl_irt_dev_getpid __libnacl_irt_dev_getpid | 35 extern struct nacl_irt_dev_getpid __libnacl_irt_dev_getpid |
| 36 __attribute__((weak)); | 36 __attribute__((weak)); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 if (nacl_irt_ext_structs[i].table == NULL) | 102 if (nacl_irt_ext_structs[i].table == NULL) |
| 103 return 0; | 103 return 0; |
| 104 | 104 |
| 105 memcpy(nacl_irt_ext_structs[i].table, table, tablesize); | 105 memcpy(nacl_irt_ext_structs[i].table, table, tablesize); |
| 106 return tablesize; | 106 return tablesize; |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 return 0; | 110 return 0; |
| 111 } | 111 } |
| OLD | NEW |