Skip to content

Commit 139ecf8

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Update changelog Remove unused HAVE_SHM_MMAP_ZERO and HAVE_SHM_MMAP_FILE
2 parents 5440100 + fa7fbfd commit 139ecf8

File tree

1 file changed

+0
-124
lines changed

1 file changed

+0
-124
lines changed

ext/opcache/config.m4

Lines changed: 0 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -212,61 +212,6 @@ int main() {
212212
msg=yes],[msg=no],[msg=no])
213213
AC_MSG_RESULT([$msg])
214214

215-
AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support)
216-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
217-
#include <sys/types.h>
218-
#include <sys/wait.h>
219-
#include <sys/mman.h>
220-
#include <sys/stat.h>
221-
#include <fcntl.h>
222-
#include <unistd.h>
223-
#include <string.h>
224-
225-
#ifndef MAP_FAILED
226-
# define MAP_FAILED ((void*)-1)
227-
#endif
228-
229-
int main() {
230-
pid_t pid;
231-
int status;
232-
int fd;
233-
char *shm;
234-
235-
fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
236-
if (fd == -1) {
237-
return 1;
238-
}
239-
240-
shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
241-
if (shm == MAP_FAILED) {
242-
return 2;
243-
}
244-
245-
strcpy(shm, "hello");
246-
247-
pid = fork();
248-
if (pid < 0) {
249-
return 5;
250-
} else if (pid == 0) {
251-
strcpy(shm, "bye");
252-
return 6;
253-
}
254-
if (wait(&status) != pid) {
255-
return 7;
256-
}
257-
if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
258-
return 8;
259-
}
260-
if (strcmp(shm, "bye") != 0) {
261-
return 9;
262-
}
263-
return 0;
264-
}
265-
]])],[dnl
266-
AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support])
267-
msg=yes],[msg=no],[msg=no])
268-
AC_MSG_RESULT([$msg])
269-
270215
AC_MSG_CHECKING(for mmap() using shm_open() shared memory support)
271216
AC_RUN_IFELSE([AC_LANG_SOURCE([[
272217
#include <sys/types.h>
@@ -336,75 +281,6 @@ int main() {
336281
msg=yes],[msg=no],[msg=no])
337282
AC_MSG_RESULT([$msg])
338283

339-
AC_MSG_CHECKING(for mmap() using regular file shared memory support)
340-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
341-
#include <sys/types.h>
342-
#include <sys/wait.h>
343-
#include <sys/mman.h>
344-
#include <sys/stat.h>
345-
#include <fcntl.h>
346-
#include <unistd.h>
347-
#include <string.h>
348-
#include <stdlib.h>
349-
#include <stdio.h>
350-
351-
#ifndef MAP_FAILED
352-
# define MAP_FAILED ((void*)-1)
353-
#endif
354-
355-
int main() {
356-
pid_t pid;
357-
int status;
358-
int fd;
359-
char *shm;
360-
char tmpname[4096];
361-
362-
sprintf(tmpname,"opcache.test.shm.%dXXXXXX", getpid());
363-
if (mktemp(tmpname) == NULL) {
364-
return 1;
365-
}
366-
fd = open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
367-
if (fd == -1) {
368-
return 2;
369-
}
370-
if (ftruncate(fd, 4096) < 0) {
371-
close(fd);
372-
unlink(tmpname);
373-
return 3;
374-
}
375-
376-
shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
377-
if (shm == MAP_FAILED) {
378-
return 4;
379-
}
380-
unlink(tmpname);
381-
close(fd);
382-
383-
strcpy(shm, "hello");
384-
385-
pid = fork();
386-
if (pid < 0) {
387-
return 5;
388-
} else if (pid == 0) {
389-
strcpy(shm, "bye");
390-
return 6;
391-
}
392-
if (wait(&status) != pid) {
393-
return 7;
394-
}
395-
if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
396-
return 8;
397-
}
398-
if (strcmp(shm, "bye") != 0) {
399-
return 9;
400-
}
401-
return 0;
402-
}
403-
]])],[dnl
404-
AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support])
405-
msg=yes],[msg=no],[msg=no])
406-
AC_MSG_RESULT([$msg])
407-
408284
PHP_NEW_EXTENSION(opcache,
409285
ZendAccelerator.c \
410286
zend_accelerator_blacklist.c \

0 commit comments

Comments
 (0)