[PATCH 2/2] linux: posix_spawn: return EINVAL on argc < 1

Cristian Rodríguez crrodriguez@opensuse.org
Wed Mar 23 14:40:43 GMT 2022


On Fri, Jan 28, 2022 at 10:04 PM Cristian Rodríguez
<crrodriguez@opensuse.org> wrote:
>
> On Fri, Jan 28, 2022 at 8:49 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> > Errors for argc == 0 (with argv != NULL) are contrary to POSIX, which
> > allows that case other than for Strictly Conforming POSIX Applications,
>
> The case you mention as valid are rejected by BSDs.. QNX and others.
> so portable applications cannot rely on this either.
> .
> freebsd head and openbsd -EINVAL with argc == 0 and has never allowed
> argv to be NULL  (EFAULTs)

it has been now addressed in the kernel

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dcd46d897adb70d63e025f175a00a89797d31a43

I think all the linux specific code in glibc at least should behave
like that for consistency.


More information about the Libc-alpha mailing list