View Issue Details

IDProjectCategoryView StatusLast Update
00020031003.1(2024)/Issue8System Interfacespublic2026-10-29 06:55
Reportertrevor.gross Assigned To 
PrioritynormalSeverityCommentTypeEnhancement Request
Status NewResolutionOpen 
NameTrevor Gross
Organization
User Reference
Sectionhttps://pubs.opengroup.org/onlinepubs/9799919799/functions/exec.html
Page Numberhttps://pubs.opengroup.org/onlinepubs/9799919799/functions/exec.html
Line Numberhttps://pubs.opengroup.org/onlinepubs/9799919799/functions/exec.html
Interp Status
Final Accepted Text
Summary0002003: Add execvpe()
DescriptionThere is currently no standard way to exec a process with path lookup, a MT-safe custom environment, and an arbitrary argument count. There are two close options:

1. Use execvp(), setting the parent's environment before calling and restoring upon failure. This may create races if other threads are running.
2. Use execle(). Use of variable arguments makes difficult for an unknown argument count.
Desired ActionStandardize execvpe(), providing the characteristics of execve() with a path lookup:

    int execvpe(const char *file, char *const argv[], char *const envp[]);

This already exists on some platforms:

1. Linux: https://linux.die.net/man/3/execvpe
2. Solaris: https://docs.oracle.com/cd/E88353_01/html/E37841/execvpe-2.html
3. QNX: https://www.qnx.com/developers/docs/8.0/com.qnx.doc.neutrino.lib_ref/topic/e/execvpe.html
Tagsissue9

Activities

trevor.gross

2026-10-29 06:55

reporter   bugnote:0007535

Alternative: introduce one or both of the following, allowing use of execve().

    /* Look up a name in path, consistent with what is done in other libc
     * functions.
     */
    size_t posix_which(const char *file, char *buf, size_t len);

    /* Retrieve the path that should be used for lookups. Typically this is
     * getenv("PATH") if available, with a fallback to confstr(_CS_PATH).
     *
     * May point to environ, a static, or an initialized-once cache. Does
     * not need to be freed.
     */
    const char *posix_getpath();

Issue History

Date Modified Username Field Change
2026-10-29 06:18 trevor.gross New Issue
2026-10-29 06:18 trevor.gross Tag Attached: issue9
2026-10-29 06:55 trevor.gross Note Added: 0007535