X-Recipient: archive-cygwin@delorie.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:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 q=dns; s=default; b=P492YJKI4BTZORcMGeWhMEqDZElEj4BkMRGOfcOnb16
	cBVQ8MBkd8hTnD2gjji4TISLMDXbVst6qMd7nlPSe2SwEt60lqUaqt50j6KWSru2
	zerE97Vmu6M6SY9nPvAnX9rtOH1znOrQYoFVgob0rOFKQWIWCls17xUc8p9U1I7Q
	=
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:message-id:date:from:mime-version:to:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	 s=default; bh=Pe/dhTunJ63KYqZ+ps3lETvqKj0=; b=gKqKERfw/xO2qa/Ne
	7WBNwYYF9/HiHxg2bOoJYtn0UsgJOIrECZJYEr4hW2TBtljNKA0UNSxRZ2I+V8bJ
	SGbcXv/azqEJys7we+l/pijD6QrAg8+UVBEDP9oxNiIaAeMVqUR0fzkH5hAEi6Tb
	gcSpLIQOECDcIIwfSkb8oC3T0M=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.2
X-HELO: mail.lysator.liu.se
Message-ID: <52428776.2000305@lysator.liu.se>
Date: Wed, 25 Sep 2013 08:49:26 +0200
From: Peter Rosin <peda@lysator.liu.se>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: [PATCH] tests: don't assume getdtablesize () <= 10000000
References: <517EF2F1.2030802@cs.ucla.edu> <5241DBE6.4000007@redhat.com> <20130925043225.GB1192@ednor.casa.cgf.cx>
In-Reply-To: <20130925043225.GB1192@ednor.casa.cgf.cx>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 2013-09-25 06:32, Christopher Faylor wrote:
> On Tue, Sep 24, 2013 at 12:37:26PM -0600, Eric Blake wrote:
>> This patch causes failures on at least test-fcntl and test-dup2 on
>> cygwin (both 32-bit and 64-bit); there, getdtablesize() currently
>> returns the current runtime value, but this value starts at 256, and
>> automatically expands as needed at runtime up to 3200.  I think cygwin
>> should be patched to make getdtablesize() return a constant 3200 (rather
>> than the current runtime value);
> 
> Why?  What does "3200" have to do with anything?  There is not supposed
> to be a hard-coded upper limit.

Go back and read the gdb session. STC in C:

#include <unistd.h>
#include <stdio.h>
#include <errno.h>
int main(void)
{
  int ret = dup2(0, 3200);
  if (ret == -1)
    printf("3200 errno %d: %s\n", errno, strerror(errno));
  else
    printf("3200 ok");

  ret = dup2(0, 3199);
  if (ret == -1)
    printf("3199 errno %d: %s\n", errno, strerror(errno));
  else
    printf("3199 ok");
  return 0;
}

output on my system:

3200 errno 9: Bad file descriptor
3199 ok


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

