Hi,

Paul Eggert <egg...@cs.ucla.edu> 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