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

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:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=pp+
BiJY2d92LoSsr79urioafPrd/sQrKLHCgaUN31omTm1nI8RQdxO+feLiF8/BQ5qB
PiAyU+45rPwZ09RMLJeeLhdK/JYB+ue1kUiS67K0pzc3U37tIZScrnKp27Ilmjsw
REfDcQEzTp301lDMTwQcAs2adExYNUn9KUljdX7M=
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:content-type
:content-transfer-encoding:mime-version; s=default; bh=7Vrnxm+lI
qqhurKgVxQaFxc+ORo=; b=oxpUBIr0MCVkVZ0EgYKWKCADOgEKPa/B1RW3xqInq
qGF2F3Idh+pEEIBTz/VJ7NKBNwva6ii3yRhEuE61JX0WDcYRu3hObEWmjcxj3TL6
UuUPMmmNoaU5PfXJ2krjy5OmD7kAOvP6JGgDp1/mwvwCvbcvDkP6Q0o7dOq/bz3t
sI=
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=brilliant, sua, H*MI:outlook
X-HELO: na01-by2-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) - thanks for a simple solution
Date: Thu, 23 Jun 2016 12:07:09 +0000
Message-ID: <DM3PR18MB0841748253525B0F97E55939DB2D0@DM3PR18MB0841.namprd18.prod.outlook.com>
authentication-results: spf=none (sender IP is ) smtp.mailfrom=SBardwell AT lbmsys DOT com;
x-ms-office365-filtering-correlation-id: 0c6b9765-2fe1-4c10-2475-08d39b5ee75a
x-microsoft-exchange-diagnostics: 1;DM3PR18MB0842;6:c/2A5bFyr5tJ3CZF17Nju8Gr2spKR9K7Abnwzev6NpRakAEureuSSL8FNVUp2eNry9iIv+IdnT2zu99dF7GSjjeUJOZRdSE97LXzBj6peamk0WFZbZSzQb7dsavMXvfnkdkunMPE+ENLJ4IugUzfJKnwSPXp242vj9pdOzJx9ELJs5BCGzTyk6o4pd/tDLV7Jy5kvL6RA1XpLMZQXS0YABU/6+e1P3V2t9PhVwWiM/l1Pax9XIY5T00XQdZVM5O/kytxW7NrnvKtM3yqsfq7WDnqxchqaFZsdytiXg8BxWS1XaFp5VcUBGmfMd8lroIcEBNuGFJisT+verQvdlEsvQ==;5:smf6BLzBmU0kw5ONBICsZgWuhwh7hQ0YHGJp0zzsRBtcYa7jrcp85YSHTltOKaS//49N1vQX4j2G6p+TESNBCHCFsOMscGD7kC6Hvtn1RAlKbtZ/dQ70+EvrFswm+ti1l8yKR/FthT03VHYrSdRz2A==;24:xsBtm30pbiLL8ssBO2XbjzaNmAQPBUFfX/jcsrF4kE6ZC4wKFN8VHaUA+whzBymGysDvlEanmDezBLc3J3ge2kAv7F+iQDDQVlcgy8dCVNk=;7:dKN5sm/Z8nfWhFjckXGGg3EyTzLq9MRoem+djbBv00vtlm7XE0dmZZCec6QIn3b2HIJr1hr/XSUSOXoSMiAG9J2BhBWVxchyQ/+vYzrKWWlLJxTyl4O/Jly4YKIwhixXEAymrsB5kesTYxysDY6MaNlRJEobUaZdXVuIzJZG9QDN9bx9N0SXG1wS1DK3xGCB2vmFL1yJXOBxHhGgIpdcnDgwpUU6Na4+D9U1xtPbgWcsm/bwEOL8bifbwKPZjWpRH3n6gy2ZKH/nsPEED8IG/g==
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM3PR18MB0842;
x-microsoft-antispam-prvs: <DM3PR18MB08428F060AC74606D26781EEDB2D0 AT DM3PR18MB0842 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)(8121501046)(5005006)(10201501046)(3002001)(6041072)(6043046);SRVR:DM3PR18MB0842;BCL:0;PCL:0;RULEID:;SRVR:DM3PR18MB0842;
x-forefront-prvs: 098291215C
x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(189002)(199003)(86362001)(2351001)(87936001)(2900100001)(3846002)(77096005)(586003)(6116002)(102836003)(106356001)(2906002)(105586002)(8676002)(1730700003)(92566002)(81166006)(74316001)(99286002)(107886002)(110136002)(33656002)(81156014)(122556002)(80792005)(450100001)(97736004)(9686002)(2501003)(305945005)(7736002)(7846002)(50986999)(5003600100003)(7696003)(189998001)(8936002)(68736007)(5002640100001)(76576001)(10400500002)(3280700002)(3660700001)(66066001)(101416001)(5640700001)(54356999);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR18MB0842;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 12:07:09.8426 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 2cb46dcc-5f81-474e-b16b-96065648dbca
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR18MB0842
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id u5NC7dEu020021

> > > > > > 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
> > > > > >
> > > > 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.
> > >
 
> Oh yeah, the inclusion of stdio.h also includes sys/select.h so the
> first (default) definition of FD_SETSIZE to 64 rules.  In theory it
> shouldn't do that so we might have to change it in the newlib headers,
> but for th time being, just define FD_SETSIZE before including any
> system header.
> 
> 
> Corinna

Brilliant! Thanks so much for figuring this out.

Steve Bardwell


- Raw text -


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