Fw: Error in posix_spawn(3) man page

C Howland cc1964t@gmail.com
Wed Dec 29 16:59:18 GMT 2021


>
>
> ------------------------------
> *From:* Newlib <newlib-bounces+craig.howland=caci.com@sourceware.org> on
> behalf of Keith Thompson <Keith.S.Thompson@gmail.com>
> *Sent:* Tuesday, December 28, 2021 10:24 PM
> *To:* newlib@sourceware.org <newlib@sourceware.org>
> *Cc:* Keith Thompson <Keith.S.Thompson@gmail.com>
> *Subject:* Error in posix_spawn(3) man page
>
>
>
> The posix_spawn(3) man page has incorrect types for the argv and
> envp parameters for the posix_spawn and posix_spawnp functions.
>
> They're shown as
>     char *const argv, char *const envp
> when they should be
>     char *const argv[], char *const envp[]
>
> Suggested patch (though I'm not 100% sure how the square brackets
> are handled when generating the man page):
>
> diff --git newlib/libc/posix/posix_spawn.c newlib/libc/posix/posix_spawn.c
> index 005471fde..85bfa6477 100644
> --- newlib/libc/posix/posix_spawn.c
> +++ newlib/libc/posix/posix_spawn.c
> @@ -39,11 +39,11 @@ SYNOPSIS
>         int posix_spawn(pid_t *<[pid]>, const char *<[path]>,
>                         const posix_spawn_file_actions_t *<[file_actions]>,
>                         const posix_spawnattr_t *<[attrp]>,
> -                       char *const <[argv]>, char *const <[envp]>);
> +                       char *const <[argv]>[], char *const <[envp]>[]);
>         int posix_spawnp(pid_t *<[pid]>, const char *<[file]>,
>                         const posix_spawn_file_actions_t *<[file_actions]>,
>                         const posix_spawnattr_t *<[attrp]>,
> -                       char *const <[argv]>, char *const <[envp]>);
> +                       char *const <[argv]>[], char *const <[envp]>[]);
>
>  DESCRIPTION
>  Use <<posix_spawn>> and <<posix_spawnp>> to create a new child process
>
> ------------------------------
>
>
The square brackets as done here will work as intended (_execve_r() is done
exactly like this).
Patch looks good (both for the doc viewpoint and for the stated intent of
making it match POSIX).
Craig


More information about the Newlib mailing list