NetBSD-Docs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: system(3) return code



Martin Husemann <martin%duskware.de@localhost> wrote:
> On Mon, Nov 07, 2022 at 02:30:02PM -0500, Jan Schaumann wrote:
> > Hi,
> > 
> > system(3) has some awkward phrasing for the case where
> > the execution of the shell fails:
> > 
> > "If execution of the shell fails, system() returns the
> > termination status for a program that terminates with
> > a call of exit(127)."
> 
> I read that as trying to say that e.g. wait(2) would give a status
> where WIFEXITED(status) is true and WEXITSTATUS(status) returns 127.

While that is the case, that's internal to system(3);
the end result for the user is that system(3) will
return 127.

-Jan


Home | Main Index | Thread Index | Old Index