aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawktexi.in
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-07-23 22:11:52 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-07-23 22:11:52 +0300
commitadb5491f2c9f49bf3d0e57f52c55bcaa4221e36e (patch)
tree4e76b81c1ec485cc10f52d47b699a894cf65a247 /doc/gawktexi.in
parentb7a631b6fa5ed5577520eccb1608956bd40a74e0 (diff)
parentde23ab7bfbea6ee03ef7386c6c203a4b2b7b7116 (diff)
downloadegawk-adb5491f2c9f49bf3d0e57f52c55bcaa4221e36e.tar.gz
egawk-adb5491f2c9f49bf3d0e57f52c55bcaa4221e36e.tar.bz2
egawk-adb5491f2c9f49bf3d0e57f52c55bcaa4221e36e.zip
Merge branch 'master' into feature/nocopy
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,