]> granicus.if.org Git - php/commitdiff
MFB: sockepair is not always available
authorJani Taskinen <jani@php.net>
Sun, 22 Jul 2007 22:17:51 +0000 (22:17 +0000)
committerJani Taskinen <jani@php.net>
Sun, 22 Jul 2007 22:17:51 +0000 (22:17 +0000)
ext/sockets/config.m4
ext/sockets/php_sockets.h
ext/sockets/sockets.c

index e88b54ecda406804bd12b28a4a8fe1848c1d987e..91dda989c83af507518027eb2a93049442dcc765 100644 (file)
@@ -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)
-
index b89f4f6eb4e385b82c2c9e808cc4780dd6c49de7..657f4276b2bd8703584d4d70369ecb827121b786 100644 (file)
@@ -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);
index 5ec6d53aa929bb2b3765f5a06099e158f33980eb..63177b1334dc9d3780369e2bbadd6685a0ef0726 100644 (file)
@@ -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