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 *res; int s = getaddrinfo(NULL, "daytime", &(const struct addrinfo){.ai_flags = AI_PASSIVE, .ai_protocol = IPPROTO_TCP}, &res); if(s) { fprintf(stderr, "Failed to get address info: %s\n", (s != EAI_SYSTEM) ? gai_strerror(s) : strerror(errno)); exit(EXIT_FAILURE); } for(const struct addrinfo *tmp = res; tmp; tmp = tmp->ai_next) { int fd = socket(tmp->ai_family, tmp->ai_socktype, tmp->ai_protocol); if(fd == -1) { perror("Failed to create socket"); } else if(close(fd) == -1) { perror("Failed to close socket"); } } freeaddrinfo(res); } This code fails with "Failed to create socket: Invalid argument". Does anyone have an idea why this happens, given that the arguments to socket() come directly from the call to getaddrinfo()? Remarkably, changing the service from "daytime" to "http" seems to fix it, which seems quite strange. I'm not subscribed, so please CC me on replies.