delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/06/23/07:32:56

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=uSq3iN+U9Wnku+1F
OmQDuybyzypzMxyqf+3HgoXAhZEXOblyC5Fbr5DLeJrccS43nBN16EJvgfonW3fm
Sz7ax51S4iGbn4xLIQ2vwFpCqONU8xOvMgapdm3YlP4wpBA/FaPUnv76lef62+VZ
JJDpOcn3xeiQ/FYKQN3hetddjk0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=tDvFESHqpQd1fyxH6B38Zi
kMDJ4=; b=sex0uwwmtiWefGZhwTq3RUDqTL06ZRdrQLtZ1ZfMjmzPaYQed/BU7i
XQe4nSkwn+VehCMQbgvpk8KUwLuIL+XcxJKORWaPmdD5fmlTCnalvJrg0coaY2kw
B+x7czVp8qThAdDO750a1wE6MAb2NY4mT0IuSAIPjL0VL76dzHS84=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=3.6 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=secondly, H*RU:sk:relay.m, Hx-spam-relays-external:0.0.0.0, H*RU:2500
X-HELO: burlywood.birch.relay.mailchannels.net
X-Sender-Id: totalchoicehosting|x-authuser|lee AT dilkie DOT com
X-Sender-Id: totalchoicehosting|x-authuser|lee AT dilkie DOT com
X-MC-Relay: Neutral
X-MailChannels-SenderId: totalchoicehosting|x-authuser|lee AT dilkie DOT com
X-MailChannels-Auth-Id: totalchoicehosting
X-MC-Loop-Signature: 1466681551291:1896951563
X-MC-Ingress-Time: 1466681551291
Subject: Re: FD_SETSIZE and sizeof(fd_set)
To: cygwin AT cygwin DOT com
References: <DM3PR18MB084148FC4EFA327DA33DB267DB2C0 AT DM3PR18MB0841 DOT namprd18 DOT prod DOT outlook DOT com> <nkf6f4$304$1 AT ger DOT gmane DOT org> <nkfenq$n3h$1 AT ger DOT gmane DOT org> <DM3PR18MB0841BD59B02E2CDAE372F2CCDB2D0 AT DM3PR18MB0841 DOT namprd18 DOT prod DOT outlook DOT com>
From: Lee Dilkie <lee DOT dilkie AT mitel DOT com>
Message-ID: <59cb34fb-3173-4af9-1b6d-17cef98b7934@mitel.com>
Date: Thu, 23 Jun 2016 07:32:33 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1
MIME-Version: 1.0
In-Reply-To: <DM3PR18MB0841BD59B02E2CDAE372F2CCDB2D0@DM3PR18MB0841.namprd18.prod.outlook.com>
X-AuthUser: lee AT dilkie DOT com


On 6/23/2016 6:54 AM, Steven Bardwell wrote:
>>>
>
> Here is a "program" that shows the issue I am worried about. It is so simple that I must be overlooking something really obvious:
>
> #include <stdio.h>
> #undef FD_SETSIZE
> #define FD_SETSIZE 256
> #include <sys/types.h>
> #include <sys/select.h>
>
> main()
> {
>         fd_set rfds;
>         fprintf(stdout, "FD_SETSIZE=%d\n", FD_SETSIZE);
>         fprintf(stdout, "sizeof(fd_set)=%d\n", sizeof(fd_set));
> }
>
> Steve Bardwell
>
>

I don't know if this is still the case, but when I looked into this years ago I found that it was not possible to change the size of the fd set in linux, it's fixed at 1024 (generally), unless you rebuild the kernel.

Secondly, in the windows api, their version of an fd_set is more like a poll() implementation, you can fake out any size you want since the size of the array is the first entry.

I can't speak for the cygwin implementations, but if they offer poll() or, better, epoll(), use those.

-lee

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

- Raw text -


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