| 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 * NaCl Service Runtime. Transferrable shared memory objects. | 8 * NaCl Service Runtime. Transferrable shared memory objects. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "native_client/src/include/portability.h" | 11 #include "native_client/src/include/portability.h" |
| 12 #include "native_client/src/include/nacl_platform.h" | 12 #include "native_client/src/include/nacl_platform.h" |
| 13 | 13 |
| 14 #include <errno.h> | 14 #include <errno.h> |
| 15 #include <stdlib.h> | 15 #include <stdlib.h> |
| 16 #include <string.h> | 16 #include <string.h> |
| 17 #include <sys/types.h> | 17 #include <sys/types.h> |
| 18 #include <sys/shm.h> | 18 #include <sys/shm.h> |
| 19 | 19 |
| 20 #include "native_client/src/trusted/desc/nacl_desc_base.h" | 20 #include "native_client/src/trusted/desc/nacl_desc_base.h" |
| 21 #include "native_client/src/trusted/desc/nacl_desc_effector.h" | 21 #include "native_client/src/trusted/desc/nacl_desc_effector.h" |
| 22 #include "native_client/src/trusted/desc/linux/nacl_desc_sysv_shm.h" | 22 #include "native_client/src/trusted/desc/linux/nacl_desc_sysv_shm.h" |
| 23 | 23 |
| 24 #include "native_client/src/shared/platform/nacl_find_addrsp.h" | 24 #include "native_client/src/shared/platform/nacl_find_addrsp.h" |
| 25 #include "native_client/src/shared/platform/nacl_log.h" | 25 #include "native_client/src/shared/platform/nacl_log.h" |
| 26 #include "native_client/src/shared/platform/nacl_sync_checked.h" | 26 #include "native_client/src/shared/platform/nacl_sync_checked.h" |
| 27 | 27 |
| 28 #include "native_client/src/trusted/service_runtime/internal_errno.h" | 28 #include "native_client/src/trusted/service_runtime/internal_errno.h" |
| 29 #include "native_client/src/trusted/service_runtime/nacl_config.h" | 29 #include "native_client/src/trusted/service_runtime/nacl_config.h" |
| 30 #include "native_client/src/trusted/service_runtime/include/bits/mman.h" |
| 30 #include "native_client/src/trusted/service_runtime/include/sys/errno.h" | 31 #include "native_client/src/trusted/service_runtime/include/sys/errno.h" |
| 31 #include "native_client/src/trusted/service_runtime/include/sys/mman.h" | |
| 32 #include "native_client/src/trusted/service_runtime/include/sys/stat.h" | 32 #include "native_client/src/trusted/service_runtime/include/sys/stat.h" |
| 33 #include "native_client/src/trusted/service_runtime/sel_util.h" | 33 #include "native_client/src/trusted/service_runtime/sel_util.h" |
| 34 | 34 |
| 35 | 35 |
| 36 #if !defined(SIZE_T_MAX) | 36 #if !defined(SIZE_T_MAX) |
| 37 # define SIZE_T_MAX (~((size_t) 0)) | 37 # define SIZE_T_MAX (~((size_t) 0)) |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 /* | 40 /* |
| 41 * This file contains the implementation of the NaClDescSysvShm | 41 * This file contains the implementation of the NaClDescSysvShm |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 406 |
| 407 *out_desc = (struct NaClDesc *) ndisp; | 407 *out_desc = (struct NaClDesc *) ndisp; |
| 408 rv = 0; | 408 rv = 0; |
| 409 | 409 |
| 410 cleanup: | 410 cleanup: |
| 411 if (rv < 0) { | 411 if (rv < 0) { |
| 412 free(ndisp); | 412 free(ndisp); |
| 413 } | 413 } |
| 414 return rv; | 414 return rv; |
| 415 } | 415 } |
| OLD | NEW |