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: List-Subscribe: List-Archive: List-Post: List-Help: , 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: From: Lee Dilkie 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 > #undef FD_SETSIZE > #define FD_SETSIZE 256 > #include > #include > > 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