10 eval { my @n = getprotobyname "tcp" };
11 $haspe = 1 unless $@ && $@ =~ /unimplemented|unsupported/i;
12 unless ($haspe) { print "1..0 # Skip: no getprotobyname\n"; exit 0 }
14 $haspe = 0 unless $Config{'i_netdb'} eq 'define';
15 unless ($haspe) { print "1..0 # Skip: no netdb.h\n"; exit 0 }
19 our @protoent = getprotobyname "tcp"; # This is the function getprotobyname.
20 unless (@protoent) { print "1..0 # Skip: no tcp protocol\n"; exit 0 }
29 my $protoent = getprotobyname "tcp"; # This is the OO getprotobyname.
31 print "not " unless $protoent->name eq $protoent[0];
34 print "not " unless $protoent->proto == $protoent[2];
37 # Testing pretty much anything else is unportable.