]> granicus.if.org Git - php/commitdiff
Fix Haiku build
authorDavid Carlier <devnexen@gmail.com>
Wed, 17 Jun 2020 21:16:29 +0000 (21:16 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 19 Jun 2020 15:21:55 +0000 (17:21 +0200)
getrusage supports only two fields. The network api sits in the network lib.

Closes GH-5732.

configure.ac
ext/opcache/jit/zend_jit_perf_dump.c
ext/standard/microtime.c
sapi/phpdbg/phpdbg.c

index ded516b01f095790fceaf9ab9fff4c8dbdfc7c2d..e830acfb25582e9f6ad9854257feeaac12c4035b 100644 (file)
@@ -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,
index 663f9ae1e05cca277f43e244f20c08a0eead8a9d..e61c49289535e60d3322815e0a490e73c085b64b 100644 (file)
 #include <unistd.h>
 #include <time.h>
 #include <sys/mman.h>
-#include <sys/syscall.h>
 
-#if defined(__darwin__)
+#if defined(__linux__)
+#include <sys/syscall.h>
+#elif defined(__darwin__)
 # include <pthread.h>
 #elif defined(__FreeBSD__)
 # include <sys/thr.h>
index b33face760ff7a05b8af15472576f2449877bab6..fe18e9b92aa9fcda1ec6dd7448aa040c7770719d 100644 (file)
@@ -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);
index ea0653fd25e2b73baef7864d927830abb2c53f20..f978c21ea348d752bc34d6cb91b806930d254628 100644 (file)
@@ -1683,6 +1683,9 @@ phpdbg_main:
                        }
 
 #ifndef _WIN32
+# ifndef SIGIO
+#  define SIGIO SIGPOLL
+# endif
                        zend_sigaction(SIGIO, &sigio_struct, NULL);
 #endif