… | |
… | |
122 | |
122 | |
123 | #include "libeio/eio.h" |
123 | #include "libeio/eio.h" |
124 | |
124 | |
125 | #ifndef POSIX_FADV_NORMAL |
125 | #ifndef POSIX_FADV_NORMAL |
126 | # define POSIX_FADV_NORMAL 0 |
126 | # define POSIX_FADV_NORMAL 0 |
127 | # define NO_FADVISE 1 |
|
|
128 | #endif |
127 | #endif |
129 | #ifndef POSIX_FADV_SEQUENTIAL |
128 | #ifndef POSIX_FADV_SEQUENTIAL |
130 | # define POSIX_FADV_SEQUENTIAL 0 |
129 | # define POSIX_FADV_SEQUENTIAL 0 |
131 | #endif |
130 | #endif |
132 | #ifndef POSIX_FADV_RANDOM |
131 | #ifndef POSIX_FADV_RANDOM |
… | |
… | |
140 | #endif |
139 | #endif |
141 | #ifndef POSIX_FADV_DONTNEED |
140 | #ifndef POSIX_FADV_DONTNEED |
142 | # define POSIX_FADV_DONTNEED 0 |
141 | # define POSIX_FADV_DONTNEED 0 |
143 | #endif |
142 | #endif |
144 | |
143 | |
145 | #if _XOPEN_SOURCE < 600 || NO_FADVISE |
144 | #if !HAVE_POSIX_FADVISE |
146 | # define posix_fadvise(a,b,c,d) errno = ENOSYS /* also return ENOSYS */ |
145 | # define posix_fadvise(a,b,c,d) errno = ENOSYS /* also return ENOSYS */ |
147 | #endif |
146 | #endif |
148 | |
147 | |
149 | #ifndef POSIX_MADV_NORMAL |
148 | #ifndef POSIX_MADV_NORMAL |
150 | # define POSIX_MADV_NORMAL 0 |
149 | # define POSIX_MADV_NORMAL 0 |
151 | # define NO_MADVISE 1 |
|
|
152 | #endif |
150 | #endif |
153 | #ifndef POSIX_MADV_SEQUENTIAL |
151 | #ifndef POSIX_MADV_SEQUENTIAL |
154 | # define POSIX_MADV_SEQUENTIAL 0 |
152 | # define POSIX_MADV_SEQUENTIAL 0 |
155 | #endif |
153 | #endif |
156 | #ifndef POSIX_MADV_RANDOM |
154 | #ifndef POSIX_MADV_RANDOM |
… | |
… | |
161 | #endif |
159 | #endif |
162 | #ifndef POSIX_MADV_DONTNEED |
160 | #ifndef POSIX_MADV_DONTNEED |
163 | # define POSIX_MADV_DONTNEED 0 |
161 | # define POSIX_MADV_DONTNEED 0 |
164 | #endif |
162 | #endif |
165 | |
163 | |
166 | #if _XOPEN_SOURCE < 600 || NO_MADVISE |
164 | #if !HAVE_POSIX_MADVISE |
167 | # define posix_madvise(a,b,c) errno = ENOSYS /* also return ENOSYS */ |
165 | # define posix_madvise(a,b,c) errno = ENOSYS /* also return ENOSYS */ |
168 | #endif |
166 | #endif |
169 | |
167 | |
170 | #ifndef PROT_NONE |
168 | #ifndef PROT_NONE |
171 | # define PROT_NONE 0 |
169 | # define PROT_NONE 0 |
… | |
… | |
638 | |
636 | |
639 | #if !_POSIX_MAPPED_FILES |
637 | #if !_POSIX_MAPPED_FILES |
640 | # define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, -1) |
638 | # define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, -1) |
641 | # define munmap(addr,length) (errno = ENOSYS, -1) |
639 | # define munmap(addr,length) (errno = ENOSYS, -1) |
642 | # define mprotect(addr,len,prot) (errno = ENOSYS, -1) |
640 | # define mprotect(addr,len,prot) (errno = ENOSYS, -1) |
|
|
641 | # define PROT_NONE 0 |
|
|
642 | # define PROT_WRITE 0 |
|
|
643 | # define MAP_PRIVATE 0 |
|
|
644 | # define MAP_SHARED 0 |
|
|
645 | # define MAP_FIXED 0 |
643 | #endif |
646 | #endif |
644 | |
647 | |
645 | #define MMAP_MAGIC PERL_MAGIC_ext |
648 | #define MMAP_MAGIC PERL_MAGIC_ext |
646 | |
649 | |
647 | static int |
650 | static int |