Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,50 @@ int main(void) {
])
])

AC_DEFUN([PHP_POLL_MECHANISMS],
[
AC_MSG_CHECKING([for polling mechanisms])
poll_mechanisms=""

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <sys/epoll.h>
], [
int fd = epoll_create(1);
return fd;
])], [
AC_DEFINE([HAVE_EPOLL], [1], [Define if epoll is available])
poll_mechanisms="$poll_mechanisms epoll"

AC_CHECK_FUNCS([epoll_pwait2], [], [], [#include <sys/epoll.h>])
])

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <sys/event.h>
#include <sys/time.h>
], [
int kq = kqueue();
return kq;
])], [
AC_DEFINE([HAVE_KQUEUE], [1], [Define if kqueue is available])
poll_mechanisms="$poll_mechanisms kqueue"
])

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <port.h>
], [
int port = port_create();
return port;
])], [
AC_DEFINE([HAVE_EVENT_PORTS], [1], [Define if event ports are available])
poll_mechanisms="$poll_mechanisms eventport"
])

dnl Set poll mechanisms including poll that is always available
poll_mechanisms="$poll_mechanisms poll"

AC_MSG_RESULT([$poll_mechanisms])
])

dnl ----------------------------------------------------------------------------
dnl Library/function existence and build sanity checks.
dnl ----------------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ AC_CHECK_HEADERS(m4_normalize([
])

PHP_FOPENCOOKIE
PHP_POLL_MECHANISMS
PHP_BROKEN_GETCWD
AS_VAR_IF([GCC], [yes], [PHP_BROKEN_GCC_STRLEN_OPT])

Expand Down Expand Up @@ -1682,6 +1683,17 @@ PHP_ADD_SOURCES_X([main],
[PHP_FASTCGI_OBJS],
[no])

PHP_ADD_SOURCES([main/poll], m4_normalize([
poll_backend_epoll.c
poll_backend_eventport.c
poll_backend_kqueue.c
poll_backend_poll.c
poll_core.c
poll_fd_table.c
poll_handle.c
]),
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])

PHP_ADD_SOURCES([main/streams], m4_normalize([
cast.c
filter.c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,25 @@ foreach ($classNames as $className) {
--EXPECT--
AssertionError
Directory
Io\IoException
Io\Poll\Backend
Io\Poll\BackendUnavailableException
Io\Poll\Context
Io\Poll\Event
Io\Poll\FailedContextInitializationException
Io\Poll\FailedHandleAddException
Io\Poll\FailedPollOperationException
Io\Poll\FailedPollWaitException
Io\Poll\FailedWatcherModificationException
Io\Poll\Handle
Io\Poll\HandleAlreadyWatchedException
Io\Poll\InactiveWatcherException
Io\Poll\InvalidHandleException
Io\Poll\PollException
Io\Poll\Watcher
RoundingMode
SortDirection
StreamBucket
StreamPollHandle
__PHP_Incomplete_Class
php_user_filter
1 change: 1 addition & 0 deletions ext/standard/basic_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
BASIC_MINIT_SUBMODULE(browscap)
BASIC_MINIT_SUBMODULE(standard_filters)
BASIC_MINIT_SUBMODULE(user_filters)
BASIC_MINIT_SUBMODULE(poll)
BASIC_MINIT_SUBMODULE(password)
BASIC_MINIT_SUBMODULE(image)

Expand Down
1 change: 1 addition & 0 deletions ext/standard/basic_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ PHP_MINFO_FUNCTION(basic);

ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini);

PHP_MINIT_FUNCTION(poll);
PHP_MINIT_FUNCTION(user_filters);
PHP_RSHUTDOWN_FUNCTION(user_filters);
PHP_RSHUTDOWN_FUNCTION(browscap);
Expand Down
1 change: 1 addition & 0 deletions ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ PHP_NEW_EXTENSION([standard], m4_normalize([
image.c
incomplete_class.c
info.c
io_poll.c
iptc.c
levenshtein.c
libavifinfo/avifinfo.c
Expand Down
5 changes: 3 additions & 2 deletions ext/standard/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
crypt_sha512.c php_crypt_r.c " + (TARGET_ARCH != 'arm64'? " crc32_x86.c" : "") + " \
datetime.c dir.c dl.c dns.c dns_win32.c exec.c \
file.c filestat.c formatted_print.c fsock.c head.c html.c image.c \
info.c iptc.c link.c mail.c math.c md5.c metaphone.c microtime.c \
info.c io_poll.c iptc.c link.c mail.c math.c md5.c metaphone.c microtime.c \
net.c pack.c pageinfo.c quot_print.c soundex.c \
string.c scanf.c syslog.c type.c uniqid.c url.c var.c \
versioning.c assert.c strnatcmp.c levenshtein.c incomplete_class.c \
url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
user_filters.c uuencode.c filters.c proc_open.c password.c \
streamsfuncs.c http.c flock_compat.c hrtime.c", false /* never shared */,
streamsfuncs.c http.c flock_compat.c hrtime.c",
false /* never shared */,
'/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
ADD_SOURCES("ext/standard/libavifinfo", "avifinfo.c", "standard");
PHP_STANDARD = "yes";
Expand Down
Loading
Loading