From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward500j.mail.yandex.net (forward500j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::110]) by sourceware.org (Postfix) with ESMTPS id C3AB03858280 for ; Tue, 5 Jul 2022 15:05:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C3AB03858280 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yandex.ru Received: from iva7-6894b5479337.qloud-c.yandex.net (iva7-6894b5479337.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:6e00:0:640:6894:b547]) by forward500j.mail.yandex.net (Yandex) with ESMTP id B8A676CB7059; Tue, 5 Jul 2022 18:05:02 +0300 (MSK) Received: from iva5-344f444591f3.qloud-c.yandex.net (iva5-344f444591f3.qloud-c.yandex.net [2a02:6b8:c0c:687:0:640:344f:4445]) by iva7-6894b5479337.qloud-c.yandex.net (mxback/Yandex) with ESMTP id IdrygyHub8-52f04PiG; Tue, 05 Jul 2022 18:05:02 +0300 X-Yandex-Fwd: 2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1657033502; bh=anKa2pYOdcyh0X9Zix3GG3lhBHvdUVar5np3nruaQ2Y=; h=In-Reply-To:Subject:To:From:Message-ID:References:Date:Reply-To; b=gF7guYsVgRP8Qw0kqx1Ktqtf0AGxYlvow0kSpAqwtKV+GeXWLRVJMlOT/PZ1AD3nV W/YLG4Zz7A9d+C1Nehpm2RxrQmmzxXqscEUr8+aRlHp7TLmNPjfMlNJHsYN0mFv/KV GiioP7Wwz49ov7471NFLWsY+eLkRiS99FQNzJsIM= Authentication-Results: iva7-6894b5479337.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Received: by iva5-344f444591f3.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id EdgaaVYy3s-51d8m28h; Tue, 05 Jul 2022 18:05:01 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Tue, 05 Jul 2022 14:55:19 -0000 Date: Tue, 5 Jul 2022 17:55:19 +0300 From: Andrey Repin X-Mailer: The Bat! (v9.3.4) Professional Reply-To: cygwin@cygwin.com Message-ID: <1147442891.20220705175519@yandex.ru> To: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" , cygwin@cygwin.com Subject: Re: Typo in ? In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, KAM_THEBAT, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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: Tue, 05 Jul 2022 15:05:06 -0000 Greetings, Lavrentiev, Anton (NIH/NLM/NCBI) [C]! > 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 > ---------------------- > Now, this is the relevant part of sys/param.h looks like this: > ---------------------- > /* Max number of open files. The Posix version is OPEN_MAX. */ > /* Number of fds is virtually unlimited in cygwin, but we must provide > some reasonable value for Posix conformance */ > #define NOFILE 8192 > ---------------------- > So it's either "<= NOFILE" that was actually meant to be there in the comment (or, > an equivalent "should NOT be > NOFILE"), or FD_SETSIZE should have been defined as 8192, > if the comment is actually correct. Or maybe I'm missing something here :-) > I understand that if I redefined FD_SETSIZE in my code before including , > it'd work with whatever large (or small) fd_set I need, but that's not what I'm after. I'm no expert, but it seems the FD_SETSIZE should have been 128. Long is 8 bytes, 64 bits. One bit if one open file, 64 * 64 = 4096. -- With best regards, Andrey Repin Tuesday, July 5, 2022 17:52:26 Sorry for my terrible english...