Re: calls to socket() fail when calling getaddrinfo() with IPPROTO_TCP

2021-07-30 Thread Brian Inglis
On 2021-07-29 16:41, John Scott via Cygwin wrote: I was wondering why my daytime server doesn't work when built for Cygwin, and I have been able to narrow it down to this reproducible test case: ... This code fails with "Failed to create socket: Invalid argument". Does anyone have an idea why

Re: calls to socket() fail when calling getaddrinfo() with IPPROTO_TCP

2021-07-30 Thread John Scott via Cygwin
On Fri, 2021-07-30 at 12:47 +0200, Corinna Vinschen wrote: > I've uploaded a new developer snapshot to https://cygwin.com/snapshots > Please give it a try and report back. Thank you so much! The snapshot works perfectly and now my daytime server works without code changes. signature.asc

Re: calls to socket() fail when calling getaddrinfo() with IPPROTO_TCP

2021-07-30 Thread Corinna Vinschen via Cygwin
On Jul 30 11:34, Corinna Vinschen via Cygwin wrote: > Yeah, that's a bad joke as well. The reason is that the http service is > defined for TCP only. Not for UDP. As a result, Windows' getaddrinfo > suddenly returns a valid ai_socktype field: > > family: 23 socktype 1 protocol 6AF_INET6,

Re: calls to socket() fail when calling getaddrinfo() with IPPROTO_TCP

2021-07-30 Thread Corinna Vinschen via Cygwin
Hi John, On Jul 29 22:41, John Scott via Cygwin wrote: > Hi, > > I was wondering why my daytime server doesn't work when built for > Cygwin, and I have been able to narrow it down to this reproducible > test case: > [...] > This code fails with "Failed to create socket: Invalid argument". Does >

calls to socket() fail when calling getaddrinfo() with IPPROTO_TCP

2021-07-29 Thread John Scott via Cygwin
Hi, I was wondering why my daytime server doesn't work when built for Cygwin, and I have been able to narrow it down to this reproducible test case: #define _POSIX_C_SOURCE 200809L #include #include #include #include #include #include #include int main(void) { struct addrinfo