X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6CB5E384F032 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca X-Authority-Analysis: v=2.4 cv=Ua6U9IeN c=1 sm=1 tr=0 ts=61042c59 a=T+ovY1NZ+FAi/xYICV7Bgg==:117 a=T+ovY1NZ+FAi/xYICV7Bgg==:17 a=IkcTkHD0fZMA:10 a=ttdWN3qaAAAA:20 a=85N1-lAfAAAA:8 a=G258wBLdAAAA:8 a=uYT-Tk0qkVT609LjNaIA:9 a=QEXdDO2ut3YA:10 a=eoNOvqp80Z0A:10 a=GFAzeMCIAC0A:10 a=cyfSibbquD4hpIoiQNSb:22 a=KWKEJq5SZtRIZB4jfE0H:22 Subject: Re: calls to socket() fail when calling getaddrinfo() with IPPROTO_TCP To: cygwin AT cygwin DOT com References: <1f5c0302c156c9391d294ea9df84d93b8742a500 DOT camel AT posteo DOT net> From: Brian Inglis Organization: Systematic Software Message-ID: <19768b02-3f4e-1041-e42a-0016c8e3badd@SystematicSw.ab.ca> Date: Fri, 30 Jul 2021 10:44:08 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <1f5c0302c156c9391d294ea9df84d93b8742a500.camel@posteo.net> Content-Language: en-CA X-CMAE-Envelope: MS4xfA8jIiueHCvb8GqbeXRNDCR/HwMbbGt4p/bCBXOzA/HI8UMnc45CpDhhGaIQeOQ3oZ7LBQdqOjK46nAwBXJcA9j0j0F9wSuUmFrKCFwE8f4IBiqbNmE1 6yY56aETClWoaGUrx+6kzvWDkrUohG60KtEPlcRF98DvMPktT9G/ywr7ckFjI5wEZYklZYn4FQ1081vUBNg3pYIs9lfdJCz3ROs2vE7qBhdxV9+g2OefwItD X-Spam-Status: No, score=-1161.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cygwin AT cygwin DOT com Cc: John Scott Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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 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. These obsolete legacy time services have always been available built into the inetd server in the inetutils package: $ info inetutils inetd built-in "daytime Send back the current date and time in a human readable form. Any input is discarded. time Send back the current date and time as a 32-bit integer number, nrepresenting the number of seconds since midnight, January 1, 1900." You could download the source package to study the implementation. The time protocol client rdate is available from: https://github.com/openbsd/src/tree/master/usr.sbin/rdate As daytime is text in arbitrary display format (likely ctime(3), asctime(3)) telnet, netcat, etc. to the service port was probably used. For currently supported network time services, Meinberg has for many years provided native Windows service ports of the latest releases of the ntp.org NTP V4 client/server daemon, including a kernel serial driver interface supporting GPS devices with PPS signal pins, the latest OpenSSL, a Windows installer, and an interactive monitor to control and display service daemon NTP info, and view loopstats and peerstats graphs: https://www.meinbergglobal.com/english/sw/ntp.htm#ntp_stable https://www.meinbergglobal.com/english/sw/ntp-server-monitor.htm -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.] -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple