mirror of
https://github.com/php/php-src.git
synced 2024-12-04 23:34:25 +08:00
MFB: sockepair is not always available
This commit is contained in:
parent
e5a2101c2a
commit
4e921b7ea6
@ -18,7 +18,7 @@ if test "$PHP_SOCKETS" != "no"; then
|
||||
AC_DEFINE(HAVE_CMSGHDR,1,[Whether you have struct cmsghdr])
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS([hstrerror])
|
||||
AC_CHECK_FUNCS([hstrerror socketpair])
|
||||
AC_CHECK_HEADERS([netdb.h netinet/tcp.h sys/un.h errno.h])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h>
|
||||
@ -30,6 +30,3 @@ if test "$PHP_SOCKETS" != "no"; then
|
||||
|
||||
PHP_NEW_EXTENSION([sockets], [sockets.c], [$ext_shared])
|
||||
fi
|
||||
|
||||
PHP_CHECK_FUNC(gethostbyname2)
|
||||
|
||||
|
@ -45,7 +45,9 @@ PHP_RSHUTDOWN_FUNCTION(sockets);
|
||||
|
||||
PHP_FUNCTION(socket_select);
|
||||
PHP_FUNCTION(socket_create_listen);
|
||||
#ifdef HAVE_SOCKETPAIR
|
||||
PHP_FUNCTION(socket_create_pair);
|
||||
#endif
|
||||
PHP_FUNCTION(socket_accept);
|
||||
PHP_FUNCTION(socket_set_nonblock);
|
||||
PHP_FUNCTION(socket_set_block);
|
||||
|
@ -117,7 +117,9 @@ zend_function_entry sockets_functions[] = {
|
||||
PHP_FE(socket_select, first_through_third_args_force_ref)
|
||||
PHP_FE(socket_create, NULL)
|
||||
PHP_FE(socket_create_listen, NULL)
|
||||
#ifdef HAVE_SOCKETPAIR
|
||||
PHP_FE(socket_create_pair, fourth_arg_force_ref)
|
||||
#endif
|
||||
PHP_FE(socket_accept, NULL)
|
||||
PHP_FE(socket_set_nonblock, NULL)
|
||||
PHP_FE(socket_set_block, NULL)
|
||||
@ -1726,6 +1728,7 @@ PHP_FUNCTION(socket_set_option)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef HAVE_SOCKETPAIR
|
||||
/* {{{ proto bool socket_create_pair(int domain, int type, int protocol, array &fd) U
|
||||
Creates a pair of indistinguishable sockets and stores them in fds. */
|
||||
PHP_FUNCTION(socket_create_pair)
|
||||
@ -1786,6 +1789,7 @@ PHP_FUNCTION(socket_create_pair)
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SHUTDOWN
|
||||
/* {{{ proto bool socket_shutdown(resource socket[, int how]) U
|
||||
|
Loading…
Reference in New Issue
Block a user