View Issue Details

IDProjectCategoryView StatusLast Update
00019771003.1(2024)/Issue8System Interfacespublic2026-03-26 05:23
Reportercollinfunk Assigned To 
PrioritynormalSeverityObjectionTypeError
Status NewResolutionOpen 
NameCollin Funk
OrganizationGNU
User Reference
Sectionposix_spawn_file_actions_addclose, posix_spawn_file_actions_adddup2
Page Number1592-1596
Line Number53537-3542, 53659-53661
Interp Status
Final Accepted Text
Summary0001977: posix_spawn_file_actions_addopen and posix_spawn_file_actions_adddup2 contridiction with respect to OPEN_MAX.
DescriptionThe ERRORS section for posix_spawn_file_actions_addopen states that it should fail with errno set to EBADF if "The value specified by fildes is negative or greater than or equal to {OPEN_MAX}." It then goes on to state that "It shall not be considered an error for the fildes argument passed to these functions to specify a file descriptor for which the specified operation could not be performed at the time of the call. Any such error shall be detected when the associated file actions object is later used during a posix_spawn() or posix_spawnp() operation." The same text is used for posix_spawn_file_actions_adddup2.

On systems where the open file descriptor limit can be changed and OPEN_MAX returns the limit given by RLIMIT_NOFILE, this text is contradictory. The first quoted text suggests that increasing RLIMIT_NOFILE after posix_spawn_file_actions_addopen, but before posix_spawn, is not allowed. The second quoted text suggests that it is allowed.

The description of https://austingroupbugs.net/view.php?id=418 only mentions the second quoted text for posix_spawn_file_actions_addclose. However, at some point it seems to have changed to "these functions". Therefore, I think it was probably the intention to make this change.
Desired ActionRemove:

    The posix_spawn_file_actions_addopen() function shall fail if:

    [EBADF]
        The value specified by fildes is negative or greater than or equal to {OPEN_MAX}.

    The posix_spawn_file_actions_addclose() function shall fail if:

    [EBADF]
        The value specified by fildes is negative.

Change:

    These functions shall fail if:

To:

    These functions shall fail if:

    [EBADF]
        The value specified by fildes is negative.

Change:

    The posix_spawn_file_actions_adddup2() function shall fail if:

    [EBADF]
        The value specified by fildes or newfildes is negative or greater than or equal to {OPEN_MAX}.

To:

    The posix_spawn_file_actions_adddup2() function shall fail if:

    [EBADF]
        The value specified by fildes is negative.
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-03-26 05:23 collinfunk New Issue