print "ok 1\n";
arm(5);
- my $host = $^O eq 'MacOS' ? '127.0.0.1' : 'localhost';
- if ($has_echo && connect(T,pack_sockaddr_in(7,inet_aton($host)))){
+ my $host = $^O eq 'MacOS' || ($^O eq 'irix' && $Config{osvers} == 5) ?
+ '127.0.0.1' : 'localhost';
+ my $localhost = inet_aton($host);
+
+ if ($has_echo && defined $localhost && connect(T,pack_sockaddr_in(7,$localhost))){
arm(0);
print "ok 2\n";
}
else {
print "# You're allowed to fail tests 2 and 3 if\n";
- print "# the echo service has been disabled.\n";
+ print "# the echo service has been disabled or if your
+ print "# gethostbyname() cannot resolve your localhost.\n";
+ print "# 'Connection refused' indicates disabled echo service.\n";
print "# 'Interrupted system call' indicates a hanging echo service.\n";
print "# Error: $!\n";
print "ok 2 - skipped\n";
C<-X>, C<binmode>, C<chmod>, C<chown>, C<chroot>, C<crypt>,
C<dbmclose>, C<dbmopen>, C<dump>, C<endgrent>, C<endhostent>,
C<endnetent>, C<endprotoent>, C<endpwent>, C<endservent>, C<exec>,
-C<fcntl>, C<flock>, C<fork>, C<getgrent>, C<getgrgid>, C<gethostent>,
-C<getlogin>, C<getnetbyaddr>, C<getnetbyname>, C<getnetent>,
+C<fcntl>, C<flock>, C<fork>, C<getgrent>, C<getgrgid>, C<gethostbyname>,
+C<gethostent>, C<getlogin>, C<getnetbyaddr>, C<getnetbyname>, C<getnetent>,
C<getppid>, C<getprgp>, C<getpriority>, C<getprotobynumber>,
C<getprotoent>, C<getpwent>, C<getpwnam>, C<getpwuid>,
C<getservbyport>, C<getservent>, C<getsockopt>, C<glob>, C<ioctl>,
Not implemented. (S<Mac OS>, Win32, VMS, VM/ESA)
+=item gethostbyname
+
+C<gethostbyname('localhost')> does not work everywhere: you may have
+to use C<gethostbyname('127.0.0.1')>. (S<Mac OS>, S<Irix 5>)
+
=item gethostent
Not implemented. (S<Mac OS>, Win32)