From 54d4c5309c2a3293e70c8e4243a645cdb04fcd28 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 17 Jun 2020 21:16:29 +0000 Subject: [PATCH] Haiku build fix proposal. getrusage supports only two fields. The network api sits in the network lib. --- configure.ac | 3 +++ ext/opcache/jit/zend_jit_perf_dump.c | 5 +++-- ext/standard/microtime.c | 2 +- sapi/phpdbg/phpdbg.c | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index ded516b01f095..e830acfb25582 100644 --- a/configure.ac +++ b/configure.ac @@ -601,6 +601,9 @@ AX_FUNC_WHICH_GETHOSTBYNAME_R dnl Some systems (like OpenSolaris) do not have nanosleep in libc. PHP_CHECK_FUNC_LIB(nanosleep, rt) +dnl Haiku does not have network api in libc. +PHP_CHECK_FUNC_LIB(setsockopt, network) + dnl Check for getaddrinfo, should be a better way, but... Also check for working dnl getaddrinfo. AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo, diff --git a/ext/opcache/jit/zend_jit_perf_dump.c b/ext/opcache/jit/zend_jit_perf_dump.c index 663f9ae1e05cc..e61c49289535e 100644 --- a/ext/opcache/jit/zend_jit_perf_dump.c +++ b/ext/opcache/jit/zend_jit_perf_dump.c @@ -22,9 +22,10 @@ #include #include #include -#include -#if defined(__darwin__) +#if defined(__linux__) +#include +#elif defined(__darwin__) # include #elif defined(__FreeBSD__) # include diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index b33face760ff7..fe18e9b92aa9f 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -128,7 +128,7 @@ PHP_FUNCTION(getrusage) #ifdef PHP_WIN32 /* Windows only implements a limited amount of fields from the rusage struct */ PHP_RUSAGE_PARA(ru_majflt); PHP_RUSAGE_PARA(ru_maxrss); -#elif !defined(_OSD_POSIX) +#elif !defined(_OSD_POSIX) && !defined(__HAIKU__) PHP_RUSAGE_PARA(ru_oublock); PHP_RUSAGE_PARA(ru_inblock); PHP_RUSAGE_PARA(ru_msgsnd); diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index ea0653fd25e2b..f978c21ea348d 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1683,6 +1683,9 @@ int main(int argc, char **argv) /* {{{ */ } #ifndef _WIN32 +# ifndef SIGIO +# define SIGIO SIGPOLL +# endif zend_sigaction(SIGIO, &sigio_struct, NULL); #endif