summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-01-20 20:34:36 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-01-20 20:34:36 +0000
commit2bc69dc436cd7865c8739d78d00640e6d7154cd2 (patch)
tree83018c414a663a6ee9e664b2663ab892d28580f0 /util.c
parent1b83bdba13fdb3b419d0118497fface385a6c39c (diff)
downloadperl-2bc69dc436cd7865c8739d78d00640e6d7154cd2.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@14362
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/util.c b/util.c
index 46b9ac1e2e..0d2127bb4c 100644
--- a/util.c
+++ b/util.c
@@ -4032,7 +4032,11 @@ Perl_new_vstring(pTHX_ char *s, SV *sv)
return s;
}
-#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET)
+#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) && defined(AF_INET) && defined(PF_INET) && defined(SOCK_DGRAM)
+# define EMULATE_SOCKETPAIR_UDP
+#endif
+
+#ifdef EMULATE_SOCKETPAIR_UDP
static int
S_socketpair_udp (int fd[2]) {
dTHX;
@@ -4198,8 +4202,10 @@ Perl_my_socketpair (int family, int type, int protocol, int fd[2]) {
return -1;
}
+#ifdef EMULATE_SOCKETPAIR_UDP
if (type == SOCK_DGRAM)
return S_socketpair_udp (fd);
+#endif
listener = PerlSock_socket (AF_INET, type, 0);
if (listener == -1)