diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-03-11 12:01:44 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-03-11 12:01:44 +0200 |
commit | e3cc36f1f2f7172ea561664e34bec54c3436297a (patch) | |
tree | f02812e66812a610d24968a1302793bb6fa0dbda /doc/gawktexi.in | |
parent | 8b7c7f8cc2e37a72cd71771575cf2c37a9c8d59d (diff) | |
download | egawk-e3cc36f1f2f7172ea561664e34bec54c3436297a.tar.gz egawk-e3cc36f1f2f7172ea561664e34bec54c3436297a.tar.bz2 egawk-e3cc36f1f2f7172ea561664e34bec54c3436297a.zip |
Further improvements in system return value and doc.
Diffstat (limited to 'doc/gawktexi.in')
-rw-r--r-- | doc/gawktexi.in | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/doc/gawktexi.in b/doc/gawktexi.in index c284f848..84b62a40 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -17583,19 +17583,20 @@ was probably a mistake.} POSIX states that @command{awk}'s @code{system()} should return the full 16-bit value. @command{gawk} steers a middle ground. -By default, it returns just the exit status. The -@option{--traditional} option causes @command{gawk} to divide -the return vaue by 256, just as Brian Kernighan's @command{awk} does. -With @option{--posix}, it returns the full 16-bit value. - -If the process was killed by a signal, @command{gawk}'s @code{system()} -returns 256 + @var{sig}, where @var{sig} is the number of the signal -that killed the process. Since exit values are eight bits, where the -values range from 0--255, using 256 + @var{sig} lets you clearly distinguish -normal exit from death-by-signal. - -If some kind of error occurred, @code{system()} returns @minus{}1. +The return values are summarized in @ref{table-system-return-values}. +@float Table,table-system-return-values +@caption{Return values from @code{system()}} +@multitable @columnfractions .40 .60 +@headitem Situation @tab Return value from @code{system()} +@item @option{--traditional} @tab C @code{system()}'s value divided by 256 +@item @option{--posix} @tab C @code{system()}'s value +@item Normal exit of command @tab Command's exit status +@item Death by signal of command @tab 256 + number of murderous signal +@item Death by signal of command with core dump @tab 512 + number of murderous signal +@item Some kind of error @tab @minus{}1 +@end multitable +@end float @end table @sidebar Controlling Output Buffering with @code{system()} |