This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate changes #7514,7813,8113,8144,8397,8398,8490 from mainline.
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 30 Jan 2001 23:28:03 +0000 (23:28 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 30 Jan 2001 23:28:03 +0000 (23:28 +0000)
More AIX lore. (7514, ext/re/hints/aix.pl)

Subject: Re: [PATCH bleadperl] Re: Not OK: perl5.7.0 +DEVEL7706    +Duseperlio on AIX4.[23]

Subject: Re: [PATCH bleadperl] Re: Not OK: perl5.7.0 +DEVEL7706    +Duseperlio on AIX4.[23] (7813, strictly speaking not yet necessary, but harmless and goes well with #8490)

Subject: [ID 20001214.002] Net::Ping patch

Subject: [patch perl@8133] Typo in my Net::Ping doc patch :(

Subject: [PATCH] add ReusePort option to IO::Socket::INET for better multicast support (resend)

Add ReuseAddr as a (preferred) alias for Reuse as we now
also have ReusePort.

Subject: [PATCH: perl@8482] minor typos in some dl_$foo.xs files

p4raw-link: @8397 on //depot/perl: 8b9593b78bae68349fbe921bb0040180d11fee29
p4raw-link: @8144 on //depot/perl: 4d69506c2d1d71db8d32dc38aa9aa6beb5cd8d07
p4raw-link: @8113 on //depot/perl: ba8309365e8a4d351bec425ce6b123adae09dde0
p4raw-link: @7813 on //depot/perl: 077440d82fe9ec9a771cee90041d18405ab6e0a3
p4raw-link: @7514 on //depot/perl: 876b7d982eb7c788fb7cfad6c5283f8e1a65c33e

p4raw-id: //depot/maint-5.6/perl@8631
p4raw-branched: from //depot/perl@8630 'branch in' ext/re/hints/aix.pl
(@7495..)
p4raw-integrated: from //depot/perl@8630 'copy in'
ext/DynaLoader/dl_dlopen.xs (@7081..) ext/DynaLoader/dl_aix.xs
(@7813..) lib/Net/Ping.pm (@8113..)
ext/IO/lib/IO/Socket/INET.pm (@8397..)

ext/DynaLoader/dl_aix.xs
ext/DynaLoader/dl_dlopen.xs
ext/IO/lib/IO/Socket/INET.pm
ext/re/hints/aix.pl [new file with mode: 0644]
lib/Net/Ping.pm

index d6acc68..b2c92d8 100644 (file)
@@ -11,6 +11,8 @@
  *  on statup...   It can probably be trimmed more.
  */
 
+#define PERLIO_NOT_STDIO 0
+
 /*
  * @(#)dlfcn.c 1.5 revision of 93/02/14  20:14:17
  * This is an unpublished work copyright (c) 1992 Helios Software GmbH
 # define FREAD(p,s,n,ldptr)    fread(p,s,n,IOPTR(ldptr))
 #endif
 
-/* If using PerlIO, redefine these macros from <ldfcn.h> */
-#ifdef USE_PERLIO
-#undef FSEEK
-#undef FREAD
-#define FSEEK(ldptr,o,p)        PerlIO_seek(IOPTR(ldptr),(p==BEGINNING)?(OFFSET(ldptr)+o):o,p)
-#define FREAD(p,s,n,ldptr)      PerlIO_read(IOPTR(ldptr),p,s*n)
-#endif
-
 /*
  * We simulate dlopen() et al. through a call to load. Because AIX has
  * no call to find an exported symbol we read the loader section of the
@@ -311,7 +305,7 @@ static void caterr(char *s)
                p++;
        switch(atoi(s)) {
        case L_ERROR_TOOMANY:
-               strcat(errbuf, "to many errors");
+               strcat(errbuf, "too many errors");
                break;
        case L_ERROR_NOLIB:
                strcat(errbuf, "can't load library");
@@ -532,11 +526,7 @@ static int readExports(ModulePtr mp)
        }
 /* This first case is a hack, since it assumes that the 3rd parameter to
    FREAD is 1. See the redefinition of FREAD above to see how this works. */
-#ifdef USE_PERLIO
-       if (FREAD(ldbuf, sh.s_size, 1, ldp) != sh.s_size) {
-#else
        if (FREAD(ldbuf, sh.s_size, 1, ldp) != 1) {
-#endif
                errvalid++;
                strcpy(errbuf, "readExports: cannot read loader section");
                safefree(ldbuf);
index 350b0d5..e1b2a82 100644 (file)
            SaveError("%s",dlerror()) ;
 
    Note that SaveError() takes a printf format string. Use a "%s" as
-   the first parameter if the error may contain and % characters.
+   the first parameter if the error may contain any % characters.
 
 */
 
index c922bf3..d2cc488 100644 (file)
@@ -151,11 +151,16 @@ sub configure {
        $sock->socket(AF_INET, $type, $proto) or
            return _error($sock, $!, "$!");
 
-       if ($arg->{Reuse}) {
+       if ($arg->{Reuse} || $arg->{ReuseAddr}) {
            $sock->sockopt(SO_REUSEADDR,1) or
                    return _error($sock, $!, "$!");
        }
 
+       if ($arg->{ReusePort}) {
+           $sock->sockopt(SO_REUSEPORT,1) or
+                   return _error($sock, $!, "$!");
+       }
+
        if($lport || ($laddr ne INADDR_ANY) || exists $arg->{Listen}) {
            $sock->bind($lport || 0, $laddr) or
                    return _error($sock, $!, "$!");
@@ -302,7 +307,9 @@ C<IO::Socket::INET> provides.
     Proto      Protocol name (or number)    "tcp" | "udp" | ...
     Type       Socket type                  SOCK_STREAM | SOCK_DGRAM | ...
     Listen     Queue size for listen
-    Reuse      Set SO_REUSEADDR before binding
+    ReuseAddr  Set SO_REUSEADDR before binding
+    Reuse      Set SO_REUSEADDR before binding (deprecated, prefer ReuseAddr)
+    ReusePort  Set SO_REUSEPORT before binding
     Timeout    Timeout value for various operations
     MultiHomed  Try all adresses for multi-homed hosts
 
diff --git a/ext/re/hints/aix.pl b/ext/re/hints/aix.pl
new file mode 100644 (file)
index 0000000..4fbfefd
--- /dev/null
@@ -0,0 +1,22 @@
+# Add explicit link to deb.o to pick up .Perl_deb symbol which is not
+# mentioned in perl.exp for earlier cc (xlc) versions in at least
+# non DEBUGGING builds
+#  Peter Prymmer <pvhp@best.com>
+
+use Config;
+
+if ($^O eq 'aix' && defined($Config{'ccversion'}) && 
+    ( $Config{'ccversion'} =~ /^3\.\d/
+      # needed for at least these versions:
+      # $Config{'ccversion'} eq '3.6.6.0' 
+      # $Config{'ccversion'} eq '3.6.4.0' 
+      # $Config{'ccversion'} eq '3.1.4.0'  AIX 4.2
+      # $Config{'ccversion'} eq '3.1.4.10' AIX 4.2
+      # $Config{'ccversion'} eq '3.1.3.3' 
+      ||
+      $Config{'ccversion'} =~ /^4\.4\.0\.[0-3]/
+    )
+   ) {
+    $self->{OBJECT} .= ' ../../deb$(OBJ_EXT)';
+}
+
index e3006f9..a2846fe 100644 (file)
@@ -460,6 +460,11 @@ received from the remote host and the received packet contains the
 same data as the packet that was sent, the remote host is considered
 reachable.  This protocol does not require any special privileges.
 
+It should be borne in mind that, for both tcp and udp ping, a host
+will be reported as unreachable if it is not running the
+appropriate echo service.  For Unix-like systems see L<inetd(8)> for
+more information.
+
 If the "icmp" protocol is specified, the ping() method sends an icmp
 echo message to the remote host, which is what the UNIX ping program
 does.  If the echoed message is received from the remote host and