delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/07/06/10:23:57

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 829303858012
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1657117436;
bh=OyIzMBBgZL6GOIYWuZpX+pdDQVKRHndFc5bJgNm78CA=;
h=Date:From:To:Subject:References:In-Reply-To:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
Reply-To:From;
b=TSgTawekMnclOiEXj1zBoEUDx1B58EpMeCVu72lkhN0KkWCaq7e5RuBZAfajhXBIt
IWZlHM0ehFDTcc/aazMYGn64rWcwZRg+5xx3zuCkQ8Z+g2ZM3kYX9HdtLtvnxHWSxW
eLjhxo1MtzbzN+Se8LCSQOVOqGhjWbg7pflzlaV4=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
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
Date: Wed, 6 Jul 2022 16:22:47 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Typo in <sys/select.h>?
Message-ID: <YsWat3DLV9KEH/UG@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <DM8PR09MB70954B30D740E778EB65BA41A5819 AT DM8PR09MB7095 DOT namprd09 DOT prod DOT outlook DOT com>
<1c3256fd-ed7b-8ee3-adcd-b1d8ef2fff84 AT cornell DOT edu>
<YsU9APd87h5vUJtZ AT calimero DOT vinschen DOT de>
<ea3de3f0-ed55-bfcf-f543-a95e38b98599 AT dronecode DOT org DOT uk>
<YsWZHryhvF3+WcEv AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <Y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wDb+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 AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

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 <sys/select.h>
> 
>   /* 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

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019