> Date: Sun, 13 Aug 2023 13:03:09 +0200 > From: Rhialto <rhia...@falu.nl> > > On Sat 12 Aug 2023 at 11:58:36 +0000, Taylor R Campbell wrote: > > Cons: > > - POSIX doesn't ask system(3) to work when SIGCHLD is set to SIG_IGN > > or when it has SA_NOCLDWAIT set, so this code is nonportable anyway; > > I read through > https://pubs.opengroup.org/onlinepubs/007908799/xsh/system.html and it > seems entirely silent on the matter. How does this mean that system(3) > is allowed to fail in this situation? Since the state is not mentioned > as a special case, I expect that it is supposed to work.
Newer versions of POSIX give a sample implementation of system(3) which fails the same way under these circumstances: https://pubs.opengroup.org/onlinepubs/9699919799/functions/system.html The only thing it does with SIGCHLD is block it temporarily.