4 unless(grep /blib/, @INC) {
14 if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bSocket\b/) {
15 $reason = 'Socket extension unavailable';
17 elsif ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bIO\b/) {
18 $reason = 'IO extension unavailable';
20 elsif ($^O eq 'os2') {
23 eval {IO::Socket::pack_sockaddr_un('/foo/bar') || 1}
24 or $@ !~ /not implemented/ or
25 $reason = 'compiled without TCP/IP stack v4';
27 elsif ($^O =~ m/^(?:qnx|nto|vos)$/ ) {
28 $reason = 'Not implemented';
30 elsif (! $Config{'d_fork'}) {
34 print "1..0 # Skip: $reason\n";
41 # Test if we can create the file within the tmp directory
42 if (-e $PATH or not open(TEST, ">$PATH") and $^O ne 'os2') {
43 print "1..0 # Skip: cannot open '$PATH' for write\n";
47 unlink($PATH) or $^O eq 'os2' or die "Can't unlink $PATH: $!";
55 $listen = IO::Socket::UNIX->new(Local=>$PATH, Listen=>0) || die "$!";
60 $sock = $listen->accept();
65 print $sock->getline();
72 unlink($PATH) || $^O eq 'os2' || warn "Can't unlink $PATH: $!";
76 print "# accept() failed: $!\n";
78 print "not ok $_ # accept failed\n";
81 } elsif(defined $pid) {
83 $sock = IO::Socket::UNIX->new(Peer => $PATH) or die "$!";
87 print $sock->getline();