summaryrefslogtreecommitdiff
path: root/ext/Socket
diff options
context:
space:
mode:
authorAndy Dougherty <doughera.lafayette.edu>1995-12-02 03:25:17 +0000
committerAndy Dougherty <doughera.lafayette.edu>1995-12-02 03:25:17 +0000
commit25f94b330371810ad4761e17a4e200e6752044c5 (patch)
treedb359228af3b637f3e3d66b7e60a7c80b3180328 /ext/Socket
parentf8881bd9b4aab880d830b06ff42f1da38fceee8a (diff)
downloadperl-25f94b330371810ad4761e17a4e200e6752044c5.tar.gz
This is patch.2b1d to perl5.002beta1.
cd to your perl source directory and type patch -p1 -N < patch.2b1a This patch includes patches for the following items: NETaa14710: Included bsdi_bsdos.sh hint file. pod/perlre.pod: Mention 32bit limit. Configure Updates. Update Socket.xs to version 1.5. This handles systems that might not have <sys/un.h>. Fix missing quotes in h2ph.PL These are each described in detail below, after the corresponding index line. Patch and enjoy, Andy Dougherty doughera@lafcol.lafayette.edu Dept. of Physics Lafayette College, Easton PA 18042
Diffstat (limited to 'ext/Socket')
-rw-r--r--ext/Socket/Makefile.PL2
-rw-r--r--ext/Socket/Socket.pm3
-rw-r--r--ext/Socket/Socket.xs11
3 files changed, 14 insertions, 2 deletions
diff --git a/ext/Socket/Makefile.PL b/ext/Socket/Makefile.PL
index 2b3b08305a..a12c3394f6 100644
--- a/ext/Socket/Makefile.PL
+++ b/ext/Socket/Makefile.PL
@@ -1,2 +1,2 @@
use ExtUtils::MakeMaker;
-WriteMakefile(VERSION => 1.3);
+WriteMakefile(VERSION => 1.5);
diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm
index 9c0f04ba0a..f96fbec083 100644
--- a/ext/Socket/Socket.pm
+++ b/ext/Socket/Socket.pm
@@ -1,5 +1,5 @@
package Socket;
-$VERSION = 1.3;
+$VERSION = 1.5;
=head1 NAME
@@ -117,6 +117,7 @@ In an array context, unpacks its SOCKADDR_UN argument and returns an array
consisting of (PATHNAME). In a scalar context, packs its PATHANE
arguments as a SOCKADDR_UN and returns it. If this is confusing, use
pack_sockaddr_un() and unpack_sockaddr_un() explicitly.
+These are only supported if your system has <sys/un.h>.
=item pack_sockaddr_un PATH
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs
index e799c81e89..191afa6032 100644
--- a/ext/Socket/Socket.xs
+++ b/ext/Socket/Socket.xs
@@ -7,7 +7,9 @@
# include <sys/types.h>
# endif
#include <sys/socket.h>
+#ifdef I_SYS_UN
#include <sys/un.h>
+#endif
# ifdef I_NETINET_IN
# include <netinet/in.h>
# endif
@@ -632,11 +634,16 @@ pack_sockaddr_un(pathname)
char * pathname
CODE:
{
+#ifdef I_SYS_UN
struct sockaddr_un sun_ad; /* fear using sun */
Zero( &sun_ad, sizeof sun_ad, char );
sun_ad.sun_family = AF_UNIX;
Copy( pathname, sun_ad.sun_path, sizeof sun_ad.sun_path, char );
ST(0) = sv_2mortal(newSVpv((char *)&sun_ad, sizeof sun_ad));
+#else
+ ST(0) = (SV *) not_here("pack_sockaddr_un");
+#endif
+
}
void
@@ -644,6 +651,7 @@ unpack_sockaddr_un(sun_sv)
SV * sun_sv
PPCODE:
{
+#ifdef I_SYS_UN
STRLEN sockaddrlen;
struct sockaddr_un addr;
char * sun_ad = SvPV(sun_sv,sockaddrlen);
@@ -663,6 +671,9 @@ unpack_sockaddr_un(sun_sv)
AF_UNIX);
}
ST(0) = sv_2mortal(newSVpv(addr.sun_path, strlen(addr.sun_path)));
+#else
+ ST(0) = (SV *) not_here("unpack_sockaddr_un");
+#endif
}
void