@@ -141,61 +141,6 @@ int main() {
141
141
msg=yes] ,[ msg=no] ,[ msg=no] )
142
142
AC_MSG_RESULT ( [ $msg] )
143
143
144
- AC_MSG_CHECKING ( for mmap ( ) using / dev/zero shared memory support )
145
- AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
146
- #include <sys/types.h>
147
- #include <sys/wait.h>
148
- #include <sys/mman.h>
149
- #include <sys/stat.h>
150
- #include <fcntl.h>
151
- #include <unistd.h>
152
- #include <string.h>
153
-
154
- #ifndef MAP_FAILED
155
- # define MAP_FAILED ((void*)-1)
156
- #endif
157
-
158
- int main() {
159
- pid_t pid;
160
- int status;
161
- int fd;
162
- char *shm;
163
-
164
- fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
165
- if (fd == -1) {
166
- return 1;
167
- }
168
-
169
- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
170
- if (shm == MAP_FAILED) {
171
- return 2;
172
- }
173
-
174
- strcpy(shm, "hello");
175
-
176
- pid = fork();
177
- if (pid < 0) {
178
- return 5;
179
- } else if (pid == 0) {
180
- strcpy(shm, "bye");
181
- return 6;
182
- }
183
- if (wait(&status) != pid) {
184
- return 7;
185
- }
186
- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
187
- return 8;
188
- }
189
- if (strcmp(shm, "bye") != 0) {
190
- return 9;
191
- }
192
- return 0;
193
- }
194
- ] ] ) ] ,[ dnl
195
- AC_DEFINE ( HAVE_SHM_MMAP_ZERO , 1 , [ Define if you have mmap("/dev/zero") SHM support] )
196
- msg=yes] ,[ msg=no] ,[ msg=no] )
197
- AC_MSG_RESULT ( [ $msg] )
198
-
199
144
AC_MSG_CHECKING ( for mmap ( ) using shm_open ( ) shared memory support )
200
145
AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
201
146
#include <sys/types.h>
@@ -265,75 +210,6 @@ int main() {
265
210
msg=yes] ,[ msg=no] ,[ msg=no] )
266
211
AC_MSG_RESULT ( [ $msg] )
267
212
268
- AC_MSG_CHECKING ( for mmap ( ) using regular file shared memory support )
269
- AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
270
- #include <sys/types.h>
271
- #include <sys/wait.h>
272
- #include <sys/mman.h>
273
- #include <sys/stat.h>
274
- #include <fcntl.h>
275
- #include <unistd.h>
276
- #include <string.h>
277
- #include <stdlib.h>
278
- #include <stdio.h>
279
-
280
- #ifndef MAP_FAILED
281
- # define MAP_FAILED ((void*)-1)
282
- #endif
283
-
284
- int main() {
285
- pid_t pid;
286
- int status;
287
- int fd;
288
- char *shm;
289
- char tmpname[ 4096] ;
290
-
291
- sprintf(tmpname,"opcache.test.shm.%dXXXXXX", getpid());
292
- if (mktemp(tmpname) == NULL) {
293
- return 1;
294
- }
295
- fd = open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
296
- if (fd == -1) {
297
- return 2;
298
- }
299
- if (ftruncate(fd, 4096) < 0) {
300
- close(fd);
301
- unlink(tmpname);
302
- return 3;
303
- }
304
-
305
- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
306
- if (shm == MAP_FAILED) {
307
- return 4;
308
- }
309
- unlink(tmpname);
310
- close(fd);
311
-
312
- strcpy(shm, "hello");
313
-
314
- pid = fork();
315
- if (pid < 0) {
316
- return 5;
317
- } else if (pid == 0) {
318
- strcpy(shm, "bye");
319
- return 6;
320
- }
321
- if (wait(&status) != pid) {
322
- return 7;
323
- }
324
- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
325
- return 8;
326
- }
327
- if (strcmp(shm, "bye") != 0) {
328
- return 9;
329
- }
330
- return 0;
331
- }
332
- ] ] ) ] ,[ dnl
333
- AC_DEFINE ( HAVE_SHM_MMAP_FILE , 1 , [ Define if you have mmap() SHM support] )
334
- msg=yes] ,[ msg=no] ,[ msg=no] )
335
- AC_MSG_RESULT ( [ $msg] )
336
-
337
213
PHP_NEW_EXTENSION(opcache,
338
214
ZendAccelerator.c \
339
215
zend_accelerator_blacklist.c \
0 commit comments