mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
Added support for GNU Hurd. (Svante Signell)
This commit is contained in:
parent
ea0f832f10
commit
f904830012
4 changed files with 67 additions and 38 deletions
1
NEWS
1
NEWS
|
@ -26,6 +26,7 @@ PHP NEWS
|
||||||
imap). (ryotakatsuki at gmail dot com)
|
imap). (ryotakatsuki at gmail dot com)
|
||||||
|
|
||||||
- OPcache:
|
- OPcache:
|
||||||
|
. Added support for GNU Hurd. (Svante Signell)
|
||||||
. Added function opcache_compile_file() to load PHP scripts into cache
|
. Added function opcache_compile_file() to load PHP scripts into cache
|
||||||
without execution. (Julien)
|
without execution. (Julien)
|
||||||
. Fixed bug #65665 (Exception not properly caught when opcache enabled).
|
. Fixed bug #65665 (Exception not properly caught when opcache enabled).
|
||||||
|
|
|
@ -80,6 +80,9 @@
|
||||||
# endif
|
# endif
|
||||||
# include <direct.h>
|
# include <direct.h>
|
||||||
#else
|
#else
|
||||||
|
# ifndef MAXPATHLEN
|
||||||
|
# define MAXPATHLEN 4096
|
||||||
|
# endif
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -100,7 +103,7 @@ extern int lock_file;
|
||||||
# elif defined(__svr4__)
|
# elif defined(__svr4__)
|
||||||
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
||||||
struct flock name = {type, whence, start, len}
|
struct flock name = {type, whence, start, len}
|
||||||
# elif defined(__linux__) || defined(__hpux)
|
# elif defined(__linux__) || defined(__hpux) || defined(__GNU__)
|
||||||
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
||||||
struct flock name = {type, whence, start, len, 0}
|
struct flock name = {type, whence, start, len, 0}
|
||||||
# elif defined(_AIX)
|
# elif defined(_AIX)
|
||||||
|
@ -111,6 +114,12 @@ extern int lock_file;
|
||||||
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
||||||
struct flock name = {type, whence, start, len}
|
struct flock name = {type, whence, start, len}
|
||||||
# endif
|
# endif
|
||||||
|
# elif defined(HAVE_FLOCK_BSD)
|
||||||
|
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
||||||
|
struct flock name = {start, len, -1, type, whence}
|
||||||
|
# elif defined(HAVE_FLOCK_LINUX)
|
||||||
|
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
||||||
|
struct flock name = {type, whence, start, len}
|
||||||
# else
|
# else
|
||||||
# error "Don't know how to define struct flock"
|
# error "Don't know how to define struct flock"
|
||||||
# endif
|
# endif
|
||||||
|
|
|
@ -326,40 +326,42 @@ int main() {
|
||||||
msg=yes,msg=no,msg=no)
|
msg=yes,msg=no,msg=no)
|
||||||
AC_MSG_RESULT([$msg])
|
AC_MSG_RESULT([$msg])
|
||||||
|
|
||||||
AC_MSG_CHECKING(for known struct flock definition)
|
flock_type=unknown
|
||||||
dnl Copied from ZendAccelerator.h
|
AC_MSG_CHECKING("whether flock struct is linux ordered")
|
||||||
AC_TRY_RUN([
|
AC_TRY_RUN([
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdlib.h>
|
struct flock lock = { 1, 2, 3, 4, 5 };
|
||||||
|
int main() {
|
||||||
|
if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
], [
|
||||||
|
flock_type=linux
|
||||||
|
AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
|
||||||
|
AC_MSG_RESULT("yes")
|
||||||
|
], AC_MSG_RESULT("no") )
|
||||||
|
|
||||||
#ifndef ZEND_WIN32
|
AC_MSG_CHECKING("whether flock struct is BSD ordered")
|
||||||
extern int lock_file;
|
AC_TRY_RUN([
|
||||||
|
#include <fcntl.h>
|
||||||
|
struct flock lock = { 1, 2, 3, 4, 5 };
|
||||||
|
int main() {
|
||||||
|
if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
], [
|
||||||
|
flock_type=bsd
|
||||||
|
AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
|
||||||
|
AC_MSG_RESULT("yes")
|
||||||
|
], AC_MSG_RESULT("no") )
|
||||||
|
|
||||||
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || (defined(__APPLE__) && defined(__MACH__)/* Darwin */) || defined(__OpenBSD__) || defined(__NetBSD__)
|
if test "$flock_type" == "unknown"; then
|
||||||
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
|
||||||
struct flock name = {start, len, -1, type, whence}
|
fi
|
||||||
# elif defined(__svr4__)
|
|
||||||
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
|
||||||
struct flock name = {type, whence, start, len}
|
|
||||||
# elif defined(__linux__) || defined(__hpux)
|
|
||||||
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
|
||||||
struct flock name = {type, whence, start, len, 0}
|
|
||||||
# elif defined(_AIX)
|
|
||||||
# if defined(_LARGE_FILES) || defined(__64BIT__)
|
|
||||||
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
|
||||||
struct flock name = {type, whence, 0, 0, 0, start, len }
|
|
||||||
# else
|
|
||||||
# define FLOCK_STRUCTURE(name, type, whence, start, len) \
|
|
||||||
struct flock name = {type, whence, start, len}
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# error "Don't know how to define struct flock"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
int main() { return 0; }
|
|
||||||
],
|
|
||||||
[AC_MSG_RESULT([done])],
|
|
||||||
[AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])], [])
|
|
||||||
|
|
||||||
PHP_NEW_EXTENSION(opcache,
|
PHP_NEW_EXTENSION(opcache,
|
||||||
ZendAccelerator.c \
|
ZendAccelerator.c \
|
||||||
|
|
|
@ -154,6 +154,7 @@ static const opt_struct OPTIONS[] = {
|
||||||
{'?', 0, "usage"},/* help alias (both '?' and 'usage') */
|
{'?', 0, "usage"},/* help alias (both '?' and 'usage') */
|
||||||
{'v', 0, "version"},
|
{'v', 0, "version"},
|
||||||
{'z', 1, "zend-extension"},
|
{'z', 1, "zend-extension"},
|
||||||
|
{'W', 1, "warmup"},
|
||||||
{'T', 1, "timing"},
|
{'T', 1, "timing"},
|
||||||
{'-', 0, NULL} /* end of args */
|
{'-', 0, NULL} /* end of args */
|
||||||
};
|
};
|
||||||
|
@ -1754,6 +1755,7 @@ int main(int argc, char *argv[])
|
||||||
int fcgi_fd = 0;
|
int fcgi_fd = 0;
|
||||||
fcgi_request *request = NULL;
|
fcgi_request *request = NULL;
|
||||||
int repeats = 1;
|
int repeats = 1;
|
||||||
|
int warmup_repeats = 0;
|
||||||
int benchmark = 0;
|
int benchmark = 0;
|
||||||
#if HAVE_GETTIMEOFDAY
|
#if HAVE_GETTIMEOFDAY
|
||||||
struct timeval start, end;
|
struct timeval start, end;
|
||||||
|
@ -2103,6 +2105,9 @@ consult the installation file that came with this distribution, or visit \n\
|
||||||
time(&start);
|
time(&start);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
case 'W':
|
||||||
|
warmup_repeats = atoi(php_optarg);
|
||||||
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
case '?':
|
case '?':
|
||||||
if (request) {
|
if (request) {
|
||||||
|
@ -2516,12 +2521,24 @@ fastcgi_request_done:
|
||||||
|
|
||||||
if (!fastcgi) {
|
if (!fastcgi) {
|
||||||
if (benchmark) {
|
if (benchmark) {
|
||||||
repeats--;
|
if (warmup_repeats) {
|
||||||
if (repeats > 0) {
|
warmup_repeats--;
|
||||||
script_file = NULL;
|
if (!warmup_repeats) {
|
||||||
php_optind = orig_optind;
|
#ifdef HAVE_GETTIMEOFDAY
|
||||||
php_optarg = orig_optarg;
|
gettimeofday(&start, NULL);
|
||||||
|
#else
|
||||||
|
time(&start);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
|
} else {
|
||||||
|
repeats--;
|
||||||
|
if (repeats > 0) {
|
||||||
|
script_file = NULL;
|
||||||
|
php_optind = orig_optind;
|
||||||
|
php_optarg = orig_optarg;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue