From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by sourceware.org (Postfix) with ESMTPS id 980ED386102F for ; Tue, 6 Apr 2021 14:33:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 980ED386102F Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=corinna-cygwin@cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mz9hF-1lqf8X09Rb-00wFi1 for ; Tue, 06 Apr 2021 16:33:26 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 94BB6A80773; Tue, 6 Apr 2021 16:33:25 +0200 (CEST) Date: Tue, 6 Apr 2021 16:33:25 +0200 From: Corinna Vinschen To: cygwin-developers@cygwin.com Subject: Re: Questions about select for sockets Message-ID: Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com References: <6b50ec89-5c02-c49f-ad85-e581589d21d3@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:5bgionMUgUitCuOtx5g5H+aj7kld/svnvgjHlFgSJnOx+caR0J2 TPkvHkvTtHmn3synRQ47UHEq4uZEE5JpmmwwCBjy+PKGE+WTVoEQkMpw1IAMxOFfjv66Nob 9w8gfFSc+2YCgrmASfABZ78cfe/YrFy09frlKe8E2AQJQqAkEoLlsRyKb9FMONIU6eZY5Dj 5bPOp9jzNAjOl+plUInLw== X-UI-Out-Filterresults: notjunk:1;V03:K0:OUVBsopxb60=:8Oaf50rC9u5YywWuYu6oEi tnny2p+EMCnRkrcQYlnE3cnUyrTt6m5Sm+EH1Wm4cW0J7aLS98MQguMtkjLjQshinFQVYnthY KPTb57HmmE1+cCrQdjL1l5KcJZ89B2O14FIQVNVx9mtU3TXEJ/sEvGACNWgbAOOxDcxtCRhuS ZivXAOcwPzEuk1xBILoCjCkyG1OLLfB61f4j9Fhb5EibZKGHmeQKikaeXxGkOqOyitbY7iTKT RWWxRjDtfHBhhrf+eTQyQY18Q7NBgSBukrhj3RON3uObq/xaSlYalDxu+DXTxmVfLSWf3f3zY I7Y/ad3bST4qKarw90Pan+6rB6Gj0oyGuwZwctBXyAoD7d38awQw3sd14wlnxubrOLz1+LUi/ k7u9gsHCXAETIy/t54Q9SLO6gf+RAdAodXFsFfCDWBUPiArHdqQmBmVacReSLQRWSE64xWfb8 /J0TItxh3vPox0+Jujuhukj7P8YdfZbncZdESFCbj9UNaqCFzC9T X-Spam-Status: No, score=-101.0 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Apr 2021 14:33:29 -0000 On Apr 6 16:20, Corinna Vinschen wrote: > On Apr 3 14:16, Ken Brown via Cygwin-developers wrote: > > 4. Why do we set > > > > except_ready = saw_shutdown_write () || saw_shutdown_read () ? > > > > I can't find any documentation that says that a shutdown should be > > considered an exceptional condition. On the other hand, POSIX does say, > > "Other circumstances under which a socket may be considered to have an > > exceptional condition pending are protocol-specific and > > implementation-defined." So maybe there's some Cygwin-specific reason for > > doing this? > > Nope, this is old (and wrong) cruft. Neither Steven's book nor the > Linux man pages, nor testing on Linux imply that ready for exception > is used to indicate anything other than out-of-band data. This should > be fixed. We may also have to change the saw_shutdown_read/saw_shutdown_write handling. I checked this on Linux and what happens is: After shutdown (fd, SHUT_RD), the socket is ready for reading and writing After shutdown (fd, SHUT_RDWR), the socket is ready for reading and writing After shutdown (fd, SHUT_WR), the socket is ready for writing only. Corinna