From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by sourceware.org (Postfix) with ESMTPS id C2CF93858D39 for ; Wed, 6 Jul 2022 14:22:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C2CF93858D39 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N0X4c-1nLW2e2A7A-00wV9j for ; Wed, 06 Jul 2022 16:22:48 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id E81BCA80A3C; Wed, 6 Jul 2022 16:22:47 +0200 (CEST) Date: Wed, 6 Jul 2022 16:22:47 +0200 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Typo in ? Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <1c3256fd-ed7b-8ee3-adcd-b1d8ef2fff84@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:K8XSiJCaZqpdKAS0YBNG8e0vRTyhKi8GlnvYTN6sH3bfZMa/UyF JHwxi+DrfCg9g9GsqbsLplkoBqaWRN3DZZW1D+OOipI+vOTY/JnjaucloHWJO95IiQqSSME gRvupo36hq7HNJuhP6wjNXw2ujg/crtf4IqQcei4gmuUXuoYchNpFw8xX+EO7KkdYb5xNw/ PHCdLXMs7V/8UhCO2bnLQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:HC0yktORBr4=:yjL/1Oo/Dt2+hCOXuoJLDr fyuhvwmVC7px7mtNcDntTOaVjy7uqPCCIhyDCPoG0/AzbJPWnEVcJDStyymTv07Kqks70Xp5t bO2Ku7qeNn2RzgG89TVCjjptftFN4JNjOuTXrGteSeRLuacFVNwcgSjxZMCS5xiYJr+IZDEau udf1uE6Gy7TdDRI8ZKR9kdTtNxoEzqdKwOE2DmWP5ybSxHLQdSthC5pnGHa6a5cRUmaYL6n8U nXHirDuh86ti5vChwojQRdxk/UeFHNbVqUzQHGNURkproIDdP/ADmNVO7XmEpLHyddKVxsALQ EMt0uU+zL+WYHeZ4rr0QXs+gPMl0/yV9McABPPxG88m2kJqaRin5zv+8o3+11W3rMPpmTU8iA Nmn9MAa+gbJgafUg4ZPhJc0ptRb+fKnM9AEDE9gtvxu9CM75oTa2IMN/v68DfmLGW97AycSpp 2A8J6TQZdHJaU9WUqdzzfBKyGf0z5tKXQbg/C1YYEWhBasm5nbmxUoTQjop1HNHTdH+KD6MVM rRGj4vSC78DJimXsrfztdVkHJ19GWKt3a6l9x9z4W3EMZYls/H56gzgslV1Jro9sNjHhuZi87 UYNeNbhVEGq1am3TsGmut4HojCaOHp9Zroh/ElVrI5yC06PrFqS0sVXocXRxdAjV9sXMNClrM fbXO1c83mazdFSI9bYzOYt698AbaIj9ZL4uXQAQM4/94cxzlq+M8Lr1zQi5DcCqtZ2WFoJF/Y L+/ztSjND6CMwDb+aNdEeFNHYymqpSV2Tqp/PzU1QUPb8TekOz6uB6w5bKo= X-Spam-Status: No, score=-95.0 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_FAIL, SPF_HELO_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin@cygwin.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: , X-List-Received-Date: Wed, 06 Jul 2022 14:22:51 -0000 On Jul 6 16:15, Corinna Vinschen wrote: > On Jul 6 15:01, Jon Turney wrote: > > Remember that 64 is MAXIMUM_WAIT_OBJECTS for WaitForMultipleObjects(), the > > underlying Win32 API used to implement select(), so using more than 64 hits > > some complex code to work around that... > > This isn't what FD_SETSIZE is about. FD_SETSIZE does *NOT* define the > maximum count of fd's in an fd_set. > > It defines the maximum fd number usable in an fd_set. > > So if FD_SETSIZE is defined low enough: > > #define FD_SETSIZE 3 > #include > > /* Only fd's 0, 1, and 2 will be allowed in this fd_set */ > fd_set set; > > FD_ZERO (&set); > /* This will probaly set fd to 3 */ > fd = open ("foo", O_RDONLY); > /* So this will (hopefully) fail */ > FD_SET (fd, &set); Right, this isn't quite how it works, given fd_set is a bitfield using unsigned long as basetype under the hood. This should just outline the idea behind FD_SETSIZE. Corinna