bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eric Blake
Subject: Re: [PATCH] tests: don't assume getdtablesize () <= 10000000
Date: Tue, 24 Sep 2013 12:37:26 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

[adding cygwin]

On 04/29/2013 04:23 PM, Paul Eggert wrote:
> ---

> +
> +     tests: don't assume getdtablesize () <= 10000000
> +     * modules/cloexec-tests:
> +     * modules/dup2-tests:
> +     * modules/dup3-tests:
> +     * modules/nonblocking-tests:
> +     * modules/posix_spawn_file_actions_addclose-tests:
> +     * modules/posix_spawn_file_actions_adddup2-tests:
> +     * modules/posix_spawn_file_actions_addopen-tests:
> +     * modules/unistd-safer-tests:
> +     Depend on the getdtablesize module.
> +     * tests/test-cloexec.c:
> +     * tests/test-dup-safer.c:
> +     * tests/test-dup2.c:
> +     * tests/test-dup3.c:
> +     * tests/test-fcntl.c:
> +     * tests/test-nonblocking.c:
> +     * tests/test-posix_spawn_file_actions_addclose.c:
> +     * tests/test-posix_spawn_file_actions_adddup2.c:
> +     * tests/test-posix_spawn_file_actions_addopen.c:
> +     Don't assume getdtablesize () <= 10000000.

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); but meanwhile, we need to do something
in gnulib to pick a larger value for bad_fd if getdtablesize() returns a
small runtime value.  I also wonder whether cygwin's
sysconf(_SC_OPEN_MAX) should likewise be modified.

(gdb) p getdtablesize()
$5 = 256
(gdb) p dup2(0, 256)
$6 = 256
(gdb) p getdtablesize()
$7 = 288
(gdb) p dup2(0, 3200)
$8 = -1
(gdb) p getdtablesize()
$9 = 288
(gdb) p dup2(0, 3199)
$10 = 3199
(gdb) p getdtablesize()
$11 = 3200

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]