diff options
author | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1998-04-06 11:27:22 +1200 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@ig.co.uk> | 1998-04-22 23:49:24 +0000 |
commit | 21f05f68a781e0134c6b8c37b422602799e412c8 (patch) | |
tree | 47144862bbe612e9b34df0d1b16ba5db8d9df556 | |
parent | f5fee72930ef7cff1f71854dce22f906b680c3d7 (diff) | |
download | perl-21f05f68a781e0134c6b8c37b422602799e412c8.tar.gz |
glibc2.0.6 missing MSG_* <sys/socket.h> defines.
This is a patch suitable for the maintenance track; a similar patch
is already in 5.004_64, but that version relies on a config.h variable
HAS_GNULIBC that is not available in 5.004_04. This version uses
__GLIBC__, which ought to be perfectly fine.
In glibc2.0.6 systems, the various MSG_* #defines in <sys/socket.h>
are no longer #defines. Instead, they are enums.
I have received confirmation (bug libc/545) that they will again be
#defined in 2.0.7, but I suspect that we ought to expect to
encounter 2.0.6 and the various 2.0.7-prereleases for quite a while.
p5p-msgid: Pine.SUN.3.96.980406113950.3166L-100000@newton.phys
-rw-r--r-- | ext/Socket/Socket.xs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 4f7c26fee4..a7af62b54d 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -328,8 +328,14 @@ int arg; case 'L': break; case 'M': + if (strEQ(name, "MSG_CTRUNC")) +#if defined(MSG_CTRUNC) || defined(__GLIBC__) /* XXX it's an enum */ + return MSG_CTRUNC; +#else + goto not_there; +#endif if (strEQ(name, "MSG_DONTROUTE")) -#ifdef MSG_DONTROUTE +#if defined(MSG_DONTROUTE) || defined(__GLIBC__) /* XXX it's an enum */ return MSG_DONTROUTE; #else goto not_there; @@ -341,17 +347,23 @@ int arg; goto not_there; #endif if (strEQ(name, "MSG_OOB")) -#ifdef MSG_OOB +#if defined(MSG_OOB) || defined(__GLIBC__) /* XXX it's an enum */ return MSG_OOB; #else goto not_there; #endif if (strEQ(name, "MSG_PEEK")) -#ifdef MSG_PEEK +#if defined(MSG_PEEK) || defined(__GLIBC__) /* XXX it's an enum */ return MSG_PEEK; #else goto not_there; #endif + if (strEQ(name, "MSG_PROXY")) +#if defined(MSG_PROXY) || defined(__GLIBC__) /* XXX it's an enum */ + return MSG_PROXY; +#else + goto not_there; +#endif break; case 'N': break; |