[PATCH] posix: fix system when a child cannot be created [BZ #32450]
authorAurelien Jarno <aurelien@aurel32.net>
Thu, 19 Dec 2024 22:55:15 +0000 (23:55 +0100)
committerAurelien Jarno <aurel32@debian.org>
Fri, 3 Jan 2025 10:56:38 +0000 (11:56 +0100)
commitef5d6057b30a5bd0cb72991e8dafc2455b84c9bd
treeb302d4507a9c2c389a45ca073893b0a7102161bc
parentcfcf17141eeaee2e4cd365db2bff1d7b9a4fd3a3
[PATCH] posix: fix system when a child cannot be created [BZ #32450]

POSIX states that "if a child process cannot be created, or if the
termination status for the command language interpreter cannot be
obtained, system() shall return -1 and set errno to indicate the error."

In the glibc implementation it could happen when posix_spawn fails,
which happens when the underlying fork, vfork, or clone call fails. They
could fail with EAGAIN and ENOMEM.

Resolves: BZ #32450
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Gbp-Pq: Topic any
Gbp-Pq: Name git-posix-fix-system-when-a-child-cannot-be-created-BZ-3.patch
stdlib/tst-system.c
sysdeps/posix/system.c