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 <stdio.h> | 7 #include <stdio.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
| 10 #include "native_client/src/include/nacl_defines.h" |
| 11 |
10 #if NACL_LINUX | 12 #if NACL_LINUX |
11 # include <sys/mman.h> | 13 # include <sys/mman.h> |
12 #elif NACL_OSX | 14 #elif NACL_OSX |
13 # include <mach/mach.h> | 15 # include <mach/mach.h> |
14 #endif | 16 #endif |
15 | 17 |
16 #include "gtest/gtest.h" | 18 #include "gtest/gtest.h" |
17 | 19 |
18 #include "native_client/src/include/portability_io.h" | 20 #include "native_client/src/include/portability_io.h" |
19 #include "native_client/src/trusted/desc/nacl_desc_effector_trusted_mem.h" | 21 #include "native_client/src/trusted/desc/nacl_desc_effector_trusted_mem.h" |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 // graceful. | 462 // graceful. |
461 ASSERT_TRUE(NaClPtrIsNegErrno(&map_result)); | 463 ASSERT_TRUE(NaClPtrIsNegErrno(&map_result)); |
462 ASSERT_EQ(-(intptr_t) map_result, NACL_ABI_EACCES); | 464 ASSERT_EQ(-(intptr_t) map_result, NACL_ABI_EACCES); |
463 } else { | 465 } else { |
464 // On Unix, the Map() should succeed. | 466 // On Unix, the Map() should succeed. |
465 ASSERT_FALSE(NaClPtrIsNegErrno(&map_result)); | 467 ASSERT_FALSE(NaClPtrIsNegErrno(&map_result)); |
466 AssertArrayFilled((char *) map_result, file_size); | 468 AssertArrayFilled((char *) map_result, file_size); |
467 NaClDescUnmapUnsafe(desc, (void *) map_result, file_size_rounded_up); | 469 NaClDescUnmapUnsafe(desc, (void *) map_result, file_size_rounded_up); |
468 } | 470 } |
469 } | 471 } |
OLD | NEW |