From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by sourceware.org (Postfix) with ESMTPS id 5EF713858D39 for ; Wed, 6 Jul 2022 14:16:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5EF713858D39 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 (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mgebs-1nfEhv46RQ-00h727 for ; Wed, 06 Jul 2022 16:16:00 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id D73F6A80A3C; Wed, 6 Jul 2022 16:15:58 +0200 (CEST) Date: Wed, 6 Jul 2022 16:15:58 +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:EV7hgBMSIwSfurb27xPDlx145aLTZ/bSI38xa/Z3tDA9wVT4P4u U83+InTJiGjAPBBFlhfPn47ZzTxlMvRmtS2RHF8UWHf+vQSGV7NQSv0jFwHtGebt9UAtqXB 0ZGIADAsu49SgXkeB4u68D6S3dS9jLSa6HmNtyll2QwDWfTob3/w9i3y9o47WEfx3CTo+vr Pnr69jbSAVVI89MIs4s7Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:Cx4S0IcUm+Y=:lhWCESx+e5Q41T1gIu1cv7 TT+VLW5wVj52P70DOthVlKL5qjk6rIxqLJFspVbME0bsCRAi0+BoSu4dlouFqarovJTphTiLT POSuzltmxhSnT4zPle8qceLrH4GxYMtNxwgEhJRtkHfoVYbik1jr5r1GQn0EvTryrHDn/ntUQ l7lVgMU39WIaqVtZY4lWKwZrbHd87gV8I9GIc11H2DVVtGZNgP4bXsvv53CYcxZ6swJeketzK FLu7BbnlyDERg8TaUFsIHjtD06X/eA5jLCe5GLLP6w/KMWXigWxn0zdOeCO6E5VcwP6pTBYzV hSmMA0EF+a9j3VzIvn24U2EAvBP1qekQZUfpcJz7n7kHtwGIU+qzOrO1TAmq6Soe54zd7sykt wQQ1cu12IANmn9A5WQIKReFiEAViy0RK3cZ8ZqZUdpyIMX1yQ3XnpVSlAn9JqyZd0uFZhuYSl fUyFckxcbkX9ZphdfXftdG9frw2WQZH5J5hi1amUV6JBC4bNjSyBCkxlLBjWmkRmBWDRCkxWt gqsDBPxDvly9cZXxWpdIzRd68Ksyyt47+1AsN5+afCJ3LQaCzWy6Nx1Cxm0GKSHoBqkEHRd1m oVAB35hoReTGMwjpTnAs/vveh+eLbmPYYz3FPRI+tl9v4R/dfjUtbcONn+wj9ndO32ii+mccW txvQdveNf1sIUPvrXqIl/RtZ9k/ASqYX7REMo4Z40AlxFXJ2utOQrrdyU4ZOjeVhaB2ZB9etn dv7oanZB0lUjmPxt9ZfT7ZStigb1uUiLfXWf7aMgYwcbzlwe3IO6l6IkVAs= 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:16:03 -0000 On Jul 6 15:01, Jon Turney wrote: > On 06/07/2022 08:42, Corinna Vinschen wrote: > > On Jul 5 17:51, Ken Brown wrote: > > > On 7/5/2022 10:13 AM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote: > > > > I guess we can change FD_SETSIZE to 1024 as on Linux, albeit this has no > > real meaning on Cygwin. On Linux, select(2) is really only capable to > > handle file descriptors numbers up to descriptor number 1023, but Cygwin > > doesn't have this problem. FD_SETSIZE == 64 was only something to save > > space. The bigger FD_SETSIZE, the bigger are the default fd_sets, > > something you don't want on small targets. > > > > So, yeah, something like > > > > #ifndef FD_SETSIZE > > # ifdef __CYGWIN__ > > # define FD_SETSIZE 1024 > > # else > > # define FD_SETSIZE 64 > > # endif > > #endif > > 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); Corinna