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

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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-transfer-encoding
:mime-version; q=dns; s=default; b=VeNXdtBfy/eDR5yBc8V38Ur2r0Lfv
o3XELon/86YSBbX3+/NFqq95Gf1b9sV20tb5yUNddNTyF5/gm9WT+nrG/H+8gfw2
6VC85NF8Z6c5SXeSwPDSR5L92VGVSfhbEVQXWdzmFmGc4NfPcGaYZLNsg0lUlKGF
7dwUS4QPKguboE=
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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-transfer-encoding
:mime-version; s=default; bh=12LGqj8X9GfYUrks84FGauzfUsU=; b=OBg
htypuA6M0GqD7ZwcXBvmOQG1jcnYwpoB/1CfN8h/LqQAagUz1RkkJ2M95RWm7SR0
Z0A6M+vIp/xUpHH6LZiE8NgAIZhI8X1ee0oTf1ltBD2vtUKkChWCsOKb4p9ofMsO
JkzOIhiS2LW70IyLStsDMASPh+nM3BrQZky2H/BE=
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=-1.9 required=5.0 tests=AWL,BAYES_00,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=secondly, SUA, epoll, sua
X-HELO: na01-bn1-obe.outbound.protection.outlook.com
From: Steven Bardwell <SBardwell AT lbmsys DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: FD_SETSIZE and sizeof(fd_set)
Date: Thu, 23 Jun 2016 11:36:35 +0000
Message-ID: <DM3PR18MB08415ECB5C8AD931556363A8DB2D0@DM3PR18MB0841.namprd18.prod.outlook.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> <59cb34fb-3173-4af9-1b6d-17cef98b7934 AT mitel DOT com>
In-Reply-To: <59cb34fb-3173-4af9-1b6d-17cef98b7934@mitel.com>
authentication-results: spf=none (sender IP is ) smtp.mailfrom=SBardwell AT lbmsys DOT com;
x-ms-office365-filtering-correlation-id: 4800333f-a862-4a00-c9cb-08d39b5aa22c
x-microsoft-exchange-diagnostics: 1;DM3PR18MB0843;6:e1b8VFWb/RKD1fL4qF6Lns9s9/2C5UFW4gm25PKumKdiOS3MpORkdtiBX3/wQIgIh5tVBMGqhSRi8EBbnoViZ4YxExzs60wsJ00/B6kQ04/UO3wfPHyUqpDfhIidf74rKJJMwyQxApoiB1339Os7WVUnDdDvmLqLURPKKXRhz/mPYmwOhYcUKY40g1bRiIe+ioT0K8LJOVqBInWlslLIWeLJeHMNMp5wOksDX2gEh1gRpwzKGMeC6ptamZQvlHXyutYNx0QfGe+5wC7u5apbq/EHG7VJgn5gj0dkKnvncW5g1/DCegyw1npRkUIMhYfsDgHLKXL7xjCmGBgDcKF1tA==;5:NscZaR9wn8gOInDa6jSOgjwwDn2z4lh+bHGbkdtTmW4cWTMVwaFGi2OL9NkxGKkzvG9XA5PTurkFr/xIkwre1cQ+DWzyK+8HKyo3824gVO2eHi+eFYkFWI7puGtnvt4IZMTZdcddae5BTdeJXW3zYg==;24:u48uzfv44mD73pTFoi6pSBTAkfLp2imL4ZrEVGsisdxVR2OhsMPokGRLduY7/0oKxF5OKpLTI7whVDCE7xGfU4sJ/tRJbolPtchgQ3eT7QU=;7:I9EJVe4cG8GwfEXNifvFLra65v1E4unr4Rg5+yrQk7zBPdyfBMVh6ww+indzPpLQSbDqMWj4tOUZDMzUkZ9zE1vtJ4jMhItsNZtrvQsZ3JsL2kKxudwoSsTVaVL2Bejq7ws/XTemjq2ps41cQEJBfDPI3oHfVhlW8d4vLIvq4ed/OdS2u7cgF3BMoIKyEN/mTtWZehRYtYlwRenaHdNHiARhDu52jNFuCmxBWX+U9QA1KihHx5rV7Gta3ECniHtgn+korSw7VixKaBnj/dvkSQ==
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM3PR18MB0843;
x-microsoft-antispam-prvs: <DM3PR18MB08432E128DC771BB17351B09DB2D0 AT DM3PR18MB0843 DOT namprd18 DOT prod DOT outlook DOT com>
x-exchange-antispam-report-test: UriScan:;
x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040130)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041072)(6043046);SRVR:DM3PR18MB0843;BCL:0;PCL:0;RULEID:;SRVR:DM3PR18MB0843;
x-forefront-prvs: 098291215C
x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(189002)(199003)(33656002)(77096005)(66066001)(3660700001)(5640700001)(2351001)(2950100001)(2900100001)(101416001)(450100001)(81156014)(68736007)(305945005)(586003)(11100500001)(6116002)(3846002)(102836003)(106356001)(7736002)(7846002)(105586002)(3280700002)(76576001)(9686002)(5003600100003)(7696003)(1730700003)(81166006)(8676002)(5002640100001)(2906002)(80792005)(86362001)(93886004)(2501003)(92566002)(107886002)(189998001)(110136002)(76176999)(54356999)(97736004)(10400500002)(74316001)(87936001)(99286002)(8936002)(122556002)(50986999);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR18MB0843;H:DM3PR18MB0841.namprd18.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en;
received-spf: None (protection.outlook.com: lbmsys.com does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
MIME-Version: 1.0
X-OriginatorOrg: lbmsys.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2016 11:36:35.7636 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 2cb46dcc-5f81-474e-b16b-96065648dbca
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR18MB0843
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id u5NBb3tB017450

> >
> > 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

For what it's worth, this 'program' works as expected in SUA. The size of the fd_set changes depending on the value of FD_SETSIZE.

Steve Bardwell


- Raw text -


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