summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAnantha Kesari H Y <hyanantha@php.net>2005-09-23 09:54:31 +0000
committerAnantha Kesari H Y <hyanantha@php.net>2005-09-23 09:54:31 +0000
commita3a2fe37af3ba93d3014058f0bb99c7261cecc73 (patch)
treed16d07ba7d197b742a5357d66e5811938a460474 /ext
parent09f0161160026c5ba5bbee2853d5a360225a3b96 (diff)
downloadphp-git-a3a2fe37af3ba93d3014058f0bb99c7261cecc73.tar.gz
NetWare LibC don't have socketpair function. So enabling socket_create_pair functionality only if socketpair is available in the host LibC.
--Kamesh
Diffstat (limited to 'ext')
-rw-r--r--ext/sockets/config.m41
-rw-r--r--ext/sockets/sockets.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/ext/sockets/config.m4 b/ext/sockets/config.m4
index e88b54ecda..a48e8bf6ce 100644
--- a/ext/sockets/config.m4
+++ b/ext/sockets/config.m4
@@ -31,5 +31,6 @@ if test "$PHP_SOCKETS" != "no"; then
PHP_NEW_EXTENSION([sockets], [sockets.c], [$ext_shared])
fi
+PHP_CHECK_FUNC(socketpair)
PHP_CHECK_FUNC(gethostbyname2)
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 44a40a5e01..4ceeecfb9f 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -116,7 +116,9 @@ 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)
@@ -1652,6 +1654,7 @@ PHP_FUNCTION(socket_set_option)
}
/* }}} */
+#ifdef HAVE_SOCKETPAIR
/* {{{ proto bool socket_create_pair(int domain, int type, int protocol, array &fd)
Creates a pair of indistinguishable sockets and stores them in fds. */
PHP_FUNCTION(socket_create_pair)
@@ -1711,6 +1714,7 @@ PHP_FUNCTION(socket_create_pair)
RETURN_TRUE;
}
/* }}} */
+#endif
/* {{{ proto bool socket_shutdown(resource socket[, int how])
Shuts down a socket for receiving, sending, or both. */