From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) by sourceware.org (Postfix) with ESMTPS id 260E83857C49 for ; Wed, 6 Jul 2022 07:43:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 260E83857C49 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 (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M3mHT-1o9Gnh0Fmd-000px4 for ; Wed, 06 Jul 2022 09:42:58 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 06DB2A80E21; Wed, 6 Jul 2022 09:42:57 +0200 (CEST) Date: Wed, 6 Jul 2022 09:42:56 +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: <1c3256fd-ed7b-8ee3-adcd-b1d8ef2fff84@cornell.edu> X-Provags-ID: V03:K1:0owdtmqJLRjf2oyFyooFBK0u1NTiwtZy41jCcMqyLU2K58ToYq1 dJNPB/e1P+joAhMMA7zzJHgYDkvjhI15KjdMhXprajSRnCl7PkX3pFyHO9k58oqGztBYPv/ xyuT8bsVJHuQz/tpDWpgUrUw84DaS3igr+tjs4zK+ucxyqnwMEXMrh9BTRA2wAXxzi+ae9O QjrqmAyjOyalE27QdNuIw== X-UI-Out-Filterresults: notjunk:1;V03:K0:yMBHx6ixxes=:UW6oqWCM18kJfVKPbbOyAQ 0MPeHrmVL/Iq0BnpJSyxNZP+rN5bzvAXh+rlH+swIzANoucjI59L5Umvsx8Bn7x9d8D4pqCa4 RT0x9c4GMIvcQK7MzROEmdKQDHIoPLvtn1iJCWIb+2bhmBukd3o8Egxf9M3wosvbJIR2+iU1u 29Ddg1KbNZ0hSMS0Tkpeq0bzgfsdU/TNqru/mG0y3Fcbxupl1ESwS3hm2/aDgDMusD7X9Jsiu GHO/QGBkAJWzPe0dLDpSrZsAqBvYgmynSH2Es8L5lmsqZd5gUX6S2lC6wq3CPp+SrEYOoWlsd TUwbghQpwtQrSHwhx8e2oMLSaaT7dpRrTvmY4Z34TBFA+EdDl2rs6bFg+T8bXOaCayl7cRa/X XM2JAEzkVmIkq7tzWv+IPWMesLznBoFxeV/wAxP1wmJVMXk6lCBZtjJUhgbFP5BxeZTtMKZjV rogbWpAcnY4eMPfFy5rhJ8fkC5Y0dFjdZizcIpfG8Oo4tayShYPDzyVY4frJPM4YR+D786HOW mnYaOB+chbpsLjQdTJ//TnUrAtN7FtQjzW00zzSpuYwFEVUJ56UZthTmL8h0/3pacSb9pia4D vGavG2019A4rkggtSenNbBkoJhbC4fsPLBquIfHaF/DJIZp6xrQHYY46v6y2DkzMNux88vrYx Kl4/yUMT/QufRkk+1ql7wHEJiTuZs43xGf1DV/YWage9fpAzv8gDrLTktqkBIPhbN4c8CKG9O fO3pZjzIH38FErsWZGq1c9ubC4cMWzsactnGm48OzE30B2I0SsC5vKDWsQM= X-Spam-Status: No, score=-94.6 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_ASCII_DIVIDERS, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, 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 07:43:01 -0000 On Jul 5 17:51, Ken Brown wrote: > On 7/5/2022 10:13 AM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote: > > Hi, > > > > There's some inconsistency between and : > > > > sys/select.h has this: > > ----------------------- > > /* > > * Select uses bit masks of file descriptors in longs. > > * These macros manipulate such bit fields (the filesystem macros use chars). > > * FD_SETSIZE may be defined by the user, but the default here > > * should be >= NOFILE (param.h). > > */ > > #ifndef FD_SETSIZE > > #define FD_SETSIZE 64 > > #endif > > ---------------------- > > I think Cygwin's FD macros are based on FreeBSD. The most recent > on FreeBSD says: > > --------------------------------------------------------------------- > /* > * Select uses bit masks of file descriptors in longs. These macros > * manipulate such bit fields (the filesystem macros use chars). > * FD_SETSIZE may be defined by the user, but the default here should > * be enough for most uses. > */ > #ifndef FD_SETSIZE > #define FD_SETSIZE 1024 > #endif > --------------------------------------------------------------------- > > NOFILE isn't mentioned. Maybe Cygwin (or really newlib) should also remove > the reference to NOFILE and, perhaps, change the default FD_SETSIZE to 1024. NOFILE is the old BSD variant of OPEN_MAX. In Cygwin it's defined a bit weird because the values of NOFILE and OPEN_MAX don't correspond. While NOFILE is the arbitrary value 8192 (whereever I took that from back in 2003), OPEN_MAX is __OPEN_MAX which is the historical arbitrary value 3200. Linux doesn't define OPEN_MAX (X11 does for some reason) and NOFILE is based on OPEN_AX, i. e. #if !defined NOFILE && defined OPEN_MAX # define NOFILE OPEN_MAX #endif We should probably do the same on the master branch. In theory there should be no source anymore actually requiring on of these macros. > But Cygwin isn't the only newlib target, so there might be good reasons to > keep it at 64. > > Corinna, WDYT? Or should the discussion be moved to the newlib list? 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 would be ok for master. Corinna