develooper Front page | perl.perl5.porters | Postings from February 2019

[perl #133853] [PATCH] socket() sometimes does not set $! on failureon win32

Thread Next
From:
Tomasz Konojacki
Date:
February 19, 2019 17:28
Subject:
[perl #133853] [PATCH] socket() sometimes does not set $! on failureon win32
Message ID:
rt-4.0.24-26113-1550597295-255.133853-75-0@perl.org
# New Ticket Created by  Tomasz Konojacki 
# Please include the string:  [perl #133853]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133853 >


C:\Users\xenu>perl -MData::Dumper -MSocket -E "socket(my $foo, 111, SOCK_STREAM, IPPROTO_TCP) or die Dumper([$!, $^E, 0+$!, 0+$^E])"
$VAR1 = [
          '',
          '',
          0,
          0
        ];

C:\Users\xenu>perl -MData::Dumper -MSocket -E "socket(my $foo, PF_INET, 111, IPPROTO_TCP) or die Dumper([$!, $^E, 0+$!, 0+$^E])"
$VAR1 = [
          '',
          '',
          0,
          0
        ];

C:\Users\xenu>perl -MData::Dumper -MSocket -E "socket(my $foo, PF_INET, SOCK_STREAM, 111) or die Dumper([$!, $^E, 0+$!, 0+$^E])"
$VAR1 = [
          '',
          '',
          0,
          0
        ];

Note that it doesn't happen when PERL_ALLOW_NON_IFS_LSP env variable is
set to 1 (because it makes socket() call WSASocket() directly):

C:\Users\xenu>set PERL_ALLOW_NON_IFS_LSP=1
C:\Users\xenu>perl -MData::Dumper -MSocket -E "socket(my $foo, PF_INET, SOCK_STREAM, 111) or die Dumper([$!, $^E, 0+$!, 0+$^E])"
$VAR1 = [
          'The requested protocol has not been configured into the system, or no implementation for it exists.',
          'The requested protocol has not been configured into the system, or no implementation for it exists',
          135,
          10043
        ];


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About