[Top][All Lists]

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

Re: [bug-gawk] POSIX mode "system" returing invalid exit status

From: arnold
Subject: Re: [bug-gawk] POSIX mode "system" returing invalid exit status
Date: Sat, 24 Mar 2018 23:45:18 -0600
User-agent: Heirloom mailx 12.4 7/29/08


Steven Penny <address@hidden> wrote:

> On Fri, Mar 23, 2018 at 2:07 AM, arnold wrote:
> > When gawk behaves differently with and without --posix, there is a reason.
> Thanks for the reply. I checked here [1] and dont see any mention of "16-bit
> value". No mention here [2] either.

>From http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html:

        Execute the command given by expression in a manner equivalent to
        the system() function defined in the System Interfaces volume
        of POSIX.1-2017 and return the exit status of the command.

>From http://pubs.opengroup.org/onlinepubs/9699919799/functions/system.html:

        If command is not a null pointer, system() shall return the
        termination status of the command language interpreter in the
        format specified by waitpid().

This format is further described by 
it includes more than the just the low 8 bits of the exit status.

POSIX doesn't describe the layout of the exit status, instead specifying
macros in http://pubs.opengroup.org/onlinepubs/9699919799/functions/waitpid.html
for accessing the information.

The upshot is that gawk's --posix behavior is correct, if not terribly



reply via email to

[Prev in Thread] Current Thread [Next in Thread]