aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawktexi.in
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-07-23 22:11:22 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-07-23 22:11:22 +0300
commit52c4321094c627a582834866e33a892d778d755c (patch)
treeb537162878076ca29191d54da608d9a9382bbf49 /doc/gawktexi.in
parent6b6f36281032c034e08fada3181437c1162b55c9 (diff)
parentde23ab7bfbea6ee03ef7386c6c203a4b2b7b7116 (diff)
downloadegawk-52c4321094c627a582834866e33a892d778d755c.tar.gz
egawk-52c4321094c627a582834866e33a892d778d755c.tar.bz2
egawk-52c4321094c627a582834866e33a892d778d755c.zip
Merge branch 'master' into feature/cmake
Diffstat (limited to 'doc/gawktexi.in')
-rw-r--r--doc/gawktexi.in31
1 files changed, 20 insertions, 11 deletions
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 34d7fc20..cd59f968 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -10085,17 +10085,26 @@ a system problem closing the file or process.
In these cases, @command{gawk} sets the predefined variable
@code{ERRNO} to a string describing the problem.
-In @command{gawk},
-when closing a pipe or coprocess (input or output),
-the return value is the exit status of the command.@footnote{
-This is a full 16-bit value as returned by the @code{wait()}
-system call. See the system manual pages for information on
-how to decode this value.}
-Otherwise, it is the return value from the system's @code{close()} or
-@code{fclose()} C functions when closing input or output
-files, respectively.
-This value is zero if the close succeeds, or @minus{}1 if
-it fails.
+In @command{gawk}, starting with version 4.2, when closing a pipe or
+coprocess (input or output), the return value is the exit status of the
+command, as described in @ref{table-close-pipe-return-values}.@footnote{Prior
+to version 4.2, the return value from closing a pipe or co-process
+was the full 16-bit exit value as defined by the @code{wait()} system
+call.} Otherwise, it is the return value from the system's @code{close()}
+or @code{fclose()} C functions when closing input or output files,
+respectively. This value is zero if the close succeeds, or @minus{}1
+if it fails.
+
+@float Table,table-close-pipe-return-values
+@caption{Return values from @code{close()} of a pipe}
+@multitable @columnfractions .40 .60
+@headitem Situation @tab Return value from @code{close()}
+@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
The POSIX standard is very vague; it says that @code{close()}
returns zero on success and a nonzero value otherwise. In general,