[PATCH] tests: don't assume getdtablesize () <= 10000000

Eric Blake eblake@redhat.com
Wed Sep 25 14:06:00 GMT 2013


On 09/24/2013 10:32 PM, Christopher Faylor 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.
> 

But there IS a hard-coded limit:

http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/dtable.h?rev=1.59&content-type=text/x-cvsweb-markup&cvsroot=src

/* Initial and increment values for cygwin's fd table */
#define NOFILE_INCR    32
/* Maximum size we allow expanding to.  */
#define OPEN_MAX_MAX (100 * NOFILE_INCR)

My point is that on all other systems, even if the dtable itself
dynamically grows, getdtablesize() returns the maximum it can grow to,
not its current size.  Cygwin's behavior is the odd man out, and is
causing grief in the gnulib test suite.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20130925/20516531/attachment.sig>


More information about the Cygwin mailing list