|
|
1 | /* enable mremap on GNU/Linux */ |
|
|
2 | #ifdef __linux__ |
|
|
3 | # define _GNU_SOURCE |
|
|
4 | #endif |
|
|
5 | |
|
|
6 | /* enable the POSIX prototypes of mmap/munmap on Solaris */ |
|
|
7 | #ifdef __sun |
|
|
8 | # if __STDC_VERSION__ - 0 >= 199901L |
|
|
9 | # define _XOPEN_SOURCE 600 |
|
|
10 | # else |
|
|
11 | # define _XOPEN_SOURCE 500 |
|
|
12 | # endif |
|
|
13 | #endif |
|
|
14 | |
1 | #include "emman.h" |
15 | #include "emman.h" |
2 | |
16 | |
3 | #include <ecb.h> |
17 | #include <ecb.h> |
4 | |
18 | |
5 | #include <string.h> |
19 | #include <string.h> |
… | |
… | |
8 | # include <unistd.h> |
22 | # include <unistd.h> |
9 | #endif |
23 | #endif |
10 | |
24 | |
11 | #if _POSIX_MAPPED_FILES |
25 | #if _POSIX_MAPPED_FILES |
12 | # define USE_MMAP 1 |
26 | # define USE_MMAP 1 |
13 | # ifdef __linux__ |
|
|
14 | # define _GNU_SOURCE |
|
|
15 | # endif |
|
|
16 | # include <sys/mman.h> |
27 | # include <sys/mman.h> |
17 | # ifndef MAP_FAILED |
28 | # ifndef MAP_FAILED |
18 | # define MAP_FAILED ((void *)-1) |
29 | # define MAP_FAILED ((void *)-1) |
19 | # endif |
30 | # endif |
20 | # ifndef MAP_ANONYMOUS |
31 | # ifndef MAP_ANONYMOUS |