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: Daiki Ueno
Subject: Re: [PATCH] tests: don't assume getdtablesize () <= 10000000
Date: Tue, 11 Jun 2013 15:41:38 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi,

Paul Eggert <address@hidden> writes:

> +     * 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.

Those changes are failing on Mac OS X:

FAIL: test-posix_spawn_file_actions_addclose
============================================

test-posix_spawn_file_actions_addclose.c:45: assertion failed

FAIL: test-posix_spawn_file_actions_adddup2
===========================================

test-posix_spawn_file_actions_adddup2.c:45: assertion failed

FAIL: test-posix_spawn_file_actions_addopen
===========================================

test-posix_spawn_file_actions_addopen.c:50: assertion failed

> -    ASSERT (posix_spawn_file_actions_addopen (&actions, 10000000,
> +    ASSERT (posix_spawn_file_actions_addopen (&actions, getdtablesize (),
>                                                "foo", 0, O_RDONLY)
>              == EBADF);

It seems Mac OS X's posix_spawn_file_actions_add{open,dup2,close} do not
check the runtime limits.  Here:

* getdtablesize () == 256
* sysconfig (_SC_OPEN_MAX) == 256
* OPEN_MAX == 10240

If I replace getdtablesize () with OPEN_MAX in the above call, the test
passes, while it still fails with OPEN_MAX - 1.

Regards,
-- 
Daiki Ueno



reply via email to

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