gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-839


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-839-ge3cc36f
Date: Fri, 11 Mar 2016 10:02:43 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-4.1-stable has been updated
       via  e3cc36f1f2f7172ea561664e34bec54c3436297a (commit)
       via  8b7c7f8cc2e37a72cd71771575cf2c37a9c8d59d (commit)
       via  3952172ea5f501a92c4ccf8595ebaee34d29377d (commit)
       via  0d76c6de321ecbf2cfda7d681cfce1ca80420be2 (commit)
      from  d12f05fc27089821c78a53858f8ca60ef039d8a1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=e3cc36f1f2f7172ea561664e34bec54c3436297a

commit e3cc36f1f2f7172ea561664e34bec54c3436297a
Author: Arnold D. Robbins <address@hidden>
Date:   Fri Mar 11 12:01:44 2016 +0200

    Further improvements in system return value and doc.

diff --git a/ChangeLog b/ChangeLog
index 59eff5c..0f70076 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2016-03-10         Arnold D. Robbins     <address@hidden>
 
+       * builtin.c (do_system): Further improvements. Catch core dump
+       flag.
+
+2016-03-11         Arnold D. Robbins     <address@hidden>
+
        * builtin.c (do_system): Improve return values of system().
 
 2016-03-08         Arnold D. Robbins     <address@hidden>
diff --git a/builtin.c b/builtin.c
index da664e3..c3a3bb2 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2064,6 +2064,7 @@ do_system(int nargs)
        AWKNUM ret = 0;         /* floating point on purpose, compat Unix awk */
        char *cmd;
        char save;
+       int status;
 
        if (do_sandbox)
                fatal(_("'system' function not allowed in sandbox mode"));
@@ -2080,7 +2081,7 @@ do_system(int nargs)
                cmd[tmp->stlen] = '\0';
 
                os_restore_mode(fileno(stdin));
-               ret = system(cmd);
+               status = system(cmd);
                /*
                 * 3/2016. What to do with ret? It's never simple.
                 * POSIX says to use the full return value. BWK awk
@@ -2088,17 +2089,23 @@ do_system(int nargs)
                 * exit status but gives a weird result for death-by-signal.
                 * So we compromise as follows:
                 */
-               if (ret != -1) {
+               ret = status;
+               if (status != -1) {
                        if (do_posix)
                                ;       /* leave it alone, full 16 bits */
                        else if (do_traditional)
-                               ret /= 256.0;
-                       else if (WIFEXITED(ret))
-                               ret = WEXITSTATUS(ret); /* normal exit */
-                       else if (WIFSIGNALED(ret))
+                               ret = (status / 256.0);
+                       else if (WIFEXITED(status))
+                               ret = WEXITSTATUS(status); /* normal exit */
+                       else if (WIFSIGNALED(status)) {
+                               bool coredumped = false;
+#ifdef WCOREDUMP
+                               coredumped = WCOREDUMP(status);
+#endif
                                /* use 256 since exit values are 8 bits */
-                               ret = WTERMSIG(ret) + 256;
-                       else
+                               ret = WTERMSIG(status) +
+                                       (coredumped ? 512 : 256);
+                       } else
                                ret = 0;        /* shouldn't get here */
                }
                if ((BINMODE & BINMODE_INPUT) != 0)
diff --git a/doc/ChangeLog b/doc/ChangeLog
index afe5841..2a5fbb2 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2016-03-11         Arnold D. Robbins     <address@hidden>
+
+       * gawktexi.in: Improve system() return values documentation.
+
 2016-03-07         Arnold D. Robbins     <address@hidden>
 
        * gawktexi.in: Document system() return values.
diff --git a/doc/gawk.info b/doc/gawk.info
index f18229b..b091b75 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12814,18 +12814,21 @@ parameters are enclosed in square brackets ([ ]):
      fractional floating-point value.(2)  POSIX states that 'awk''s
      'system()' should return the full 16-bit value.
 
-     'gawk' steers a middle ground.  By default, it returns just the
-     exit status.  The '--traditional' option causes 'gawk' to divide
-     the return vaue by 256, just as Brian Kernighan's 'awk' does.  With
-     '--posix', it returns the full 16-bit value.
-
-     If the process was killed by a signal, 'gawk''s 'system()' returns
-     256 + SIG, where 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 + SIG lets you clearly distinguish normal
-     exit from death-by-signal.
-
-     If some kind of error occurred, 'system()' returns -1.
+     'gawk' steers a middle ground.  The return values are summarized in
+     *note Table 9.5: table-system-return-values.
+
+     Situation                            Return value from 'system()'
+     --------------------------------------------------------------------------
+     '--traditional'                      C 'system()''s value divided by
+                                          256
+     '--posix'                            C 'system()''s value
+     Normal exit of command               Command's exit status
+     Death by signal of command           256 + number of murderous signal
+     Death by signal of command with      512 + number of murderous signal
+     core dump
+     Some kind of error                   -1
+
+     Table 9.5: Return value from 'system()'
 
              Controlling Output Buffering with 'system()'
 
@@ -13207,7 +13210,7 @@ File: gawk.info,  Node: Bitwise Functions,  Next: Type 
Functions,  Prev: Time Fu
 two integer numbers.  In other words, the operation is performed on each
 successive pair of bits in the operands.  Three common operations are
 bitwise AND, OR, and XOR. The operations are described in *note Table
-9.5: table-bitwise-ops.
+9.6: table-bitwise-ops.
 
                      Bit operator
                |  AND  |   OR  |  XOR
@@ -13217,7 +13220,7 @@ bitwise AND, OR, and XOR. The operations are described 
in *note Table
          0     | 0   0 | 0   1 | 0   1
          1     | 0   1 | 1   1 | 1   0
 
-Table 9.5: Bitwise operations
+Table 9.6: Bitwise operations
 
    As you can see, the result of an AND operation is 1 only when _both_
 bits are 1.  The result of an OR operation is 1 if _either_ bit is 1.
@@ -32223,11 +32226,11 @@ Index
 * Buening, Andreas:                      Acknowledgments.     (line  60)
 * Buening, Andreas <1>:                  Contributors.        (line  93)
 * Buening, Andreas <2>:                  Bugs.                (line  73)
-* buffering, input/output:               I/O Functions.       (line 164)
+* buffering, input/output:               I/O Functions.       (line 167)
 * buffering, input/output <1>:           Two-way I/O.         (line  53)
 * buffering, interactive vs. noninteractive: I/O Functions.   (line  76)
 * buffers, flushing:                     I/O Functions.       (line  32)
-* buffers, flushing <1>:                 I/O Functions.       (line 164)
+* buffers, flushing <1>:                 I/O Functions.       (line 167)
 * buffers, operators for:                GNU Regexp Operators.
                                                               (line  51)
 * bug reports, email address, address@hidden: Bugs.         (line  30)
@@ -33751,7 +33754,7 @@ Index
 * output redirection:                    Redirection.         (line   6)
 * output wrapper:                        Output Wrappers.     (line   6)
 * output, buffering:                     I/O Functions.       (line  32)
-* output, buffering <1>:                 I/O Functions.       (line 164)
+* output, buffering <1>:                 I/O Functions.       (line 167)
 * output, duplicating into files:        Tee Program.         (line   6)
 * output, files, closing:                Close Files And Pipes.
                                                               (line   6)
@@ -34247,7 +34250,7 @@ Index
                                                               (line  14)
 * sidebar, Changing NR and FNR:          Auto-set.            (line 311)
 * sidebar, Controlling Output Buffering with system(): I/O Functions.
-                                                              (line 162)
+                                                              (line 165)
 * sidebar, Escape Sequences for Metacharacters: Escape Sequences.
                                                               (line 135)
 * sidebar, FS and IGNORECASE:            Field Splitting Summary.
@@ -34902,318 +34905,319 @@ Ref: table-posix-sub537317
 Ref: table-gensub-escapes538858
 Ref: Gory Details-Footnote-1539681
 Node: I/O Functions539832
-Ref: I/O Functions-Footnote-1548340
-Ref: I/O Functions-Footnote-2548488
-Node: Time Functions548608
-Ref: Time Functions-Footnote-1559113
-Ref: Time Functions-Footnote-2559181
-Ref: Time Functions-Footnote-3559339
-Ref: Time Functions-Footnote-4559450
-Ref: Time Functions-Footnote-5559562
-Ref: Time Functions-Footnote-6559789
-Node: Bitwise Functions560055
-Ref: table-bitwise-ops560649
-Ref: Bitwise Functions-Footnote-1564987
-Node: Type Functions565160
-Node: I18N Functions566316
-Node: User-defined567967
-Node: Definition Syntax568772
-Ref: Definition Syntax-Footnote-1574459
-Node: Function Example574530
-Ref: Function Example-Footnote-1577452
-Node: Function Caveats577474
-Node: Calling A Function577992
-Node: Variable Scope578950
-Node: Pass By Value/Reference581944
-Node: Return Statement585443
-Node: Dynamic Typing588422
-Node: Indirect Calls589352
-Ref: Indirect Calls-Footnote-1599603
-Node: Functions Summary599731
-Node: Library Functions602436
-Ref: Library Functions-Footnote-1606043
-Ref: Library Functions-Footnote-2606186
-Node: Library Names606357
-Ref: Library Names-Footnote-1609817
-Ref: Library Names-Footnote-2610040
-Node: General Functions610126
-Node: Strtonum Function611229
-Node: Assert Function614251
-Node: Round Function617577
-Node: Cliff Random Function619118
-Node: Ordinal Functions620134
-Ref: Ordinal Functions-Footnote-1623197
-Ref: Ordinal Functions-Footnote-2623449
-Node: Join Function623659
-Ref: Join Function-Footnote-1625429
-Node: Getlocaltime Function625629
-Node: Readfile Function629371
-Node: Shell Quoting631343
-Node: Data File Management632744
-Node: Filetrans Function633376
-Node: Rewind Function637472
-Node: File Checking639377
-Ref: File Checking-Footnote-1640711
-Node: Empty Files640912
-Node: Ignoring Assigns642891
-Node: Getopt Function644441
-Ref: Getopt Function-Footnote-1655910
-Node: Passwd Functions656110
-Ref: Passwd Functions-Footnote-1664949
-Node: Group Functions665037
-Ref: Group Functions-Footnote-1672934
-Node: Walking Arrays673141
-Node: Library Functions Summary676149
-Node: Library Exercises677555
-Node: Sample Programs678020
-Node: Running Examples678790
-Node: Clones679518
-Node: Cut Program680742
-Node: Egrep Program690671
-Ref: Egrep Program-Footnote-1698183
-Node: Id Program698293
-Node: Split Program701973
-Ref: Split Program-Footnote-1705432
-Node: Tee Program705561
-Node: Uniq Program708351
-Node: Wc Program715777
-Ref: Wc Program-Footnote-1720032
-Node: Miscellaneous Programs720126
-Node: Dupword Program721339
-Node: Alarm Program723369
-Node: Translate Program728224
-Ref: Translate Program-Footnote-1732789
-Node: Labels Program733059
-Ref: Labels Program-Footnote-1736410
-Node: Word Sorting736494
-Node: History Sorting740566
-Node: Extract Program742401
-Node: Simple Sed749930
-Node: Igawk Program753004
-Ref: Igawk Program-Footnote-1767335
-Ref: Igawk Program-Footnote-2767537
-Ref: Igawk Program-Footnote-3767659
-Node: Anagram Program767774
-Node: Signature Program770836
-Node: Programs Summary772083
-Node: Programs Exercises773297
-Ref: Programs Exercises-Footnote-1777426
-Node: Advanced Features777517
-Node: Nondecimal Data779507
-Node: Array Sorting781098
-Node: Controlling Array Traversal781798
-Ref: Controlling Array Traversal-Footnote-1790165
-Node: Array Sorting Functions790283
-Ref: Array Sorting Functions-Footnote-1795374
-Node: Two-way I/O795570
-Ref: Two-way I/O-Footnote-1801390
-Ref: Two-way I/O-Footnote-2801577
-Node: TCP/IP Networking801659
-Node: Profiling804777
-Node: Advanced Features Summary812316
-Node: Internationalization814252
-Node: I18N and L10N815732
-Node: Explaining gettext816419
-Ref: Explaining gettext-Footnote-1821442
-Ref: Explaining gettext-Footnote-2821627
-Node: Programmer i18n821792
-Ref: Programmer i18n-Footnote-1826647
-Node: Translator i18n826696
-Node: String Extraction827490
-Ref: String Extraction-Footnote-1828622
-Node: Printf Ordering828708
-Ref: Printf Ordering-Footnote-1831494
-Node: I18N Portability831558
-Ref: I18N Portability-Footnote-1834014
-Node: I18N Example834077
-Ref: I18N Example-Footnote-1836883
-Node: Gawk I18N836956
-Node: I18N Summary837601
-Node: Debugger838942
-Node: Debugging839964
-Node: Debugging Concepts840405
-Node: Debugging Terms842214
-Node: Awk Debugging844789
-Node: Sample Debugging Session845695
-Node: Debugger Invocation846229
-Node: Finding The Bug847615
-Node: List of Debugger Commands854093
-Node: Breakpoint Control855426
-Node: Debugger Execution Control859120
-Node: Viewing And Changing Data862482
-Node: Execution Stack865856
-Node: Debugger Info867493
-Node: Miscellaneous Debugger Commands871564
-Node: Readline Support876652
-Node: Limitations877548
-Node: Debugging Summary879657
-Node: Arbitrary Precision Arithmetic880830
-Node: Computer Arithmetic882246
-Ref: table-numeric-ranges885837
-Ref: Computer Arithmetic-Footnote-1886559
-Node: Math Definitions886616
-Ref: table-ieee-formats889930
-Ref: Math Definitions-Footnote-1890533
-Node: MPFR features890638
-Node: FP Math Caution892355
-Ref: FP Math Caution-Footnote-1893427
-Node: Inexactness of computations893796
-Node: Inexact representation894756
-Node: Comparing FP Values896116
-Node: Errors accumulate897198
-Node: Getting Accuracy898631
-Node: Try To Round901341
-Node: Setting precision902240
-Ref: table-predefined-precision-strings902937
-Node: Setting the rounding mode904767
-Ref: table-gawk-rounding-modes905141
-Ref: Setting the rounding mode-Footnote-1908549
-Node: Arbitrary Precision Integers908728
-Ref: Arbitrary Precision Integers-Footnote-1911712
-Node: POSIX Floating Point Problems911861
-Ref: POSIX Floating Point Problems-Footnote-1915743
-Node: Floating point summary915781
-Node: Dynamic Extensions917971
-Node: Extension Intro919524
-Node: Plugin License920790
-Node: Extension Mechanism Outline921587
-Ref: figure-load-extension922026
-Ref: figure-register-new-function923591
-Ref: figure-call-new-function924683
-Node: Extension API Description926745
-Node: Extension API Functions Introduction928193
-Node: General Data Types933005
-Ref: General Data Types-Footnote-1938960
-Node: Memory Allocation Functions939259
-Ref: Memory Allocation Functions-Footnote-1942104
-Node: Constructor Functions942203
-Node: Registration Functions943948
-Node: Extension Functions944633
-Node: Exit Callback Functions946932
-Node: Extension Version String948182
-Node: Input Parsers948845
-Node: Output Wrappers958730
-Node: Two-way processors963242
-Node: Printing Messages965506
-Ref: Printing Messages-Footnote-1966580
-Node: Updating ERRNO966733
-Node: Requesting Values967472
-Ref: table-value-types-returned968209
-Node: Accessing Parameters969092
-Node: Symbol Table Access970327
-Node: Symbol table by name970839
-Node: Symbol table by cookie972860
-Ref: Symbol table by cookie-Footnote-1977009
-Node: Cached values977073
-Ref: Cached values-Footnote-1980574
-Node: Array Manipulation980665
-Ref: Array Manipulation-Footnote-1981764
-Node: Array Data Types981801
-Ref: Array Data Types-Footnote-1984459
-Node: Array Functions984551
-Node: Flattening Arrays988409
-Node: Creating Arrays995317
-Node: Extension API Variables1000088
-Node: Extension Versioning1000724
-Node: Extension API Informational Variables1002615
-Node: Extension API Boilerplate1003679
-Node: Finding Extensions1007493
-Node: Extension Example1008052
-Node: Internal File Description1008850
-Node: Internal File Ops1012930
-Ref: Internal File Ops-Footnote-11024692
-Node: Using Internal File Ops1024832
-Ref: Using Internal File Ops-Footnote-11027215
-Node: Extension Samples1027489
-Node: Extension Sample File Functions1029018
-Node: Extension Sample Fnmatch1036667
-Node: Extension Sample Fork1038154
-Node: Extension Sample Inplace1039372
-Node: Extension Sample Ord1042582
-Node: Extension Sample Readdir1043418
-Ref: table-readdir-file-types1044307
-Node: Extension Sample Revout1045112
-Node: Extension Sample Rev2way1045701
-Node: Extension Sample Read write array1046441
-Node: Extension Sample Readfile1048383
-Node: Extension Sample Time1049478
-Node: Extension Sample API Tests1050826
-Node: gawkextlib1051318
-Node: Extension summary1053742
-Node: Extension Exercises1057434
-Node: Language History1058931
-Node: V7/SVR3.11060587
-Node: SVR41062739
-Node: POSIX1064173
-Node: BTL1065552
-Node: POSIX/GNU1066281
-Node: Feature History1071802
-Node: Common Extensions1085131
-Node: Ranges and Locales1086414
-Ref: Ranges and Locales-Footnote-11091030
-Ref: Ranges and Locales-Footnote-21091057
-Ref: Ranges and Locales-Footnote-31091292
-Node: Contributors1091513
-Node: History summary1097082
-Node: Installation1098462
-Node: Gawk Distribution1099406
-Node: Getting1099890
-Node: Extracting1100851
-Node: Distribution contents1102489
-Node: Unix Installation1108240
-Node: Quick Installation1108856
-Node: Additional Configuration Options1111283
-Node: Configuration Philosophy1113087
-Node: Non-Unix Installation1115456
-Node: PC Installation1115914
-Node: PC Binary Installation1117234
-Node: PC Compiling1119086
-Ref: PC Compiling-Footnote-11122110
-Node: PC Testing1122219
-Node: PC Using1123399
-Node: Cygwin1127513
-Node: MSYS1128283
-Node: VMS Installation1128784
-Node: VMS Compilation1129575
-Ref: VMS Compilation-Footnote-11130804
-Node: VMS Dynamic Extensions1130862
-Node: VMS Installation Details1132547
-Node: VMS Running1134800
-Node: VMS GNV1139079
-Node: VMS Old Gawk1139814
-Node: Bugs1140285
-Node: Other Versions1144482
-Node: Installation summary1151066
-Node: Notes1152124
-Node: Compatibility Mode1152989
-Node: Additions1153771
-Node: Accessing The Source1154696
-Node: Adding Code1156131
-Node: New Ports1162350
-Node: Derived Files1166838
-Ref: Derived Files-Footnote-11172323
-Ref: Derived Files-Footnote-21172358
-Ref: Derived Files-Footnote-31172956
-Node: Future Extensions1173070
-Node: Implementation Limitations1173728
-Node: Extension Design1174911
-Node: Old Extension Problems1176065
-Ref: Old Extension Problems-Footnote-11177583
-Node: Extension New Mechanism Goals1177640
-Ref: Extension New Mechanism Goals-Footnote-11181004
-Node: Extension Other Design Decisions1181193
-Node: Extension Future Growth1183306
-Node: Old Extension Mechanism1184142
-Node: Notes summary1185905
-Node: Basic Concepts1187087
-Node: Basic High Level1187768
-Ref: figure-general-flow1188050
-Ref: figure-process-flow1188735
-Ref: Basic High Level-Footnote-11192036
-Node: Basic Data Typing1192221
-Node: Glossary1195549
-Node: Copying1227495
-Node: GNU Free Documentation License1265034
-Node: Index1290152
+Ref: table-system-return-values546414
+Ref: I/O Functions-Footnote-1548479
+Ref: I/O Functions-Footnote-2548627
+Node: Time Functions548747
+Ref: Time Functions-Footnote-1559252
+Ref: Time Functions-Footnote-2559320
+Ref: Time Functions-Footnote-3559478
+Ref: Time Functions-Footnote-4559589
+Ref: Time Functions-Footnote-5559701
+Ref: Time Functions-Footnote-6559928
+Node: Bitwise Functions560194
+Ref: table-bitwise-ops560788
+Ref: Bitwise Functions-Footnote-1565126
+Node: Type Functions565299
+Node: I18N Functions566455
+Node: User-defined568106
+Node: Definition Syntax568911
+Ref: Definition Syntax-Footnote-1574598
+Node: Function Example574669
+Ref: Function Example-Footnote-1577591
+Node: Function Caveats577613
+Node: Calling A Function578131
+Node: Variable Scope579089
+Node: Pass By Value/Reference582083
+Node: Return Statement585582
+Node: Dynamic Typing588561
+Node: Indirect Calls589491
+Ref: Indirect Calls-Footnote-1599742
+Node: Functions Summary599870
+Node: Library Functions602575
+Ref: Library Functions-Footnote-1606182
+Ref: Library Functions-Footnote-2606325
+Node: Library Names606496
+Ref: Library Names-Footnote-1609956
+Ref: Library Names-Footnote-2610179
+Node: General Functions610265
+Node: Strtonum Function611368
+Node: Assert Function614390
+Node: Round Function617716
+Node: Cliff Random Function619257
+Node: Ordinal Functions620273
+Ref: Ordinal Functions-Footnote-1623336
+Ref: Ordinal Functions-Footnote-2623588
+Node: Join Function623798
+Ref: Join Function-Footnote-1625568
+Node: Getlocaltime Function625768
+Node: Readfile Function629510
+Node: Shell Quoting631482
+Node: Data File Management632883
+Node: Filetrans Function633515
+Node: Rewind Function637611
+Node: File Checking639516
+Ref: File Checking-Footnote-1640850
+Node: Empty Files641051
+Node: Ignoring Assigns643030
+Node: Getopt Function644580
+Ref: Getopt Function-Footnote-1656049
+Node: Passwd Functions656249
+Ref: Passwd Functions-Footnote-1665088
+Node: Group Functions665176
+Ref: Group Functions-Footnote-1673073
+Node: Walking Arrays673280
+Node: Library Functions Summary676288
+Node: Library Exercises677694
+Node: Sample Programs678159
+Node: Running Examples678929
+Node: Clones679657
+Node: Cut Program680881
+Node: Egrep Program690810
+Ref: Egrep Program-Footnote-1698322
+Node: Id Program698432
+Node: Split Program702112
+Ref: Split Program-Footnote-1705571
+Node: Tee Program705700
+Node: Uniq Program708490
+Node: Wc Program715916
+Ref: Wc Program-Footnote-1720171
+Node: Miscellaneous Programs720265
+Node: Dupword Program721478
+Node: Alarm Program723508
+Node: Translate Program728363
+Ref: Translate Program-Footnote-1732928
+Node: Labels Program733198
+Ref: Labels Program-Footnote-1736549
+Node: Word Sorting736633
+Node: History Sorting740705
+Node: Extract Program742540
+Node: Simple Sed750069
+Node: Igawk Program753143
+Ref: Igawk Program-Footnote-1767474
+Ref: Igawk Program-Footnote-2767676
+Ref: Igawk Program-Footnote-3767798
+Node: Anagram Program767913
+Node: Signature Program770975
+Node: Programs Summary772222
+Node: Programs Exercises773436
+Ref: Programs Exercises-Footnote-1777565
+Node: Advanced Features777656
+Node: Nondecimal Data779646
+Node: Array Sorting781237
+Node: Controlling Array Traversal781937
+Ref: Controlling Array Traversal-Footnote-1790304
+Node: Array Sorting Functions790422
+Ref: Array Sorting Functions-Footnote-1795513
+Node: Two-way I/O795709
+Ref: Two-way I/O-Footnote-1801529
+Ref: Two-way I/O-Footnote-2801716
+Node: TCP/IP Networking801798
+Node: Profiling804916
+Node: Advanced Features Summary812455
+Node: Internationalization814391
+Node: I18N and L10N815871
+Node: Explaining gettext816558
+Ref: Explaining gettext-Footnote-1821581
+Ref: Explaining gettext-Footnote-2821766
+Node: Programmer i18n821931
+Ref: Programmer i18n-Footnote-1826786
+Node: Translator i18n826835
+Node: String Extraction827629
+Ref: String Extraction-Footnote-1828761
+Node: Printf Ordering828847
+Ref: Printf Ordering-Footnote-1831633
+Node: I18N Portability831697
+Ref: I18N Portability-Footnote-1834153
+Node: I18N Example834216
+Ref: I18N Example-Footnote-1837022
+Node: Gawk I18N837095
+Node: I18N Summary837740
+Node: Debugger839081
+Node: Debugging840103
+Node: Debugging Concepts840544
+Node: Debugging Terms842353
+Node: Awk Debugging844928
+Node: Sample Debugging Session845834
+Node: Debugger Invocation846368
+Node: Finding The Bug847754
+Node: List of Debugger Commands854232
+Node: Breakpoint Control855565
+Node: Debugger Execution Control859259
+Node: Viewing And Changing Data862621
+Node: Execution Stack865995
+Node: Debugger Info867632
+Node: Miscellaneous Debugger Commands871703
+Node: Readline Support876791
+Node: Limitations877687
+Node: Debugging Summary879796
+Node: Arbitrary Precision Arithmetic880969
+Node: Computer Arithmetic882385
+Ref: table-numeric-ranges885976
+Ref: Computer Arithmetic-Footnote-1886698
+Node: Math Definitions886755
+Ref: table-ieee-formats890069
+Ref: Math Definitions-Footnote-1890672
+Node: MPFR features890777
+Node: FP Math Caution892494
+Ref: FP Math Caution-Footnote-1893566
+Node: Inexactness of computations893935
+Node: Inexact representation894895
+Node: Comparing FP Values896255
+Node: Errors accumulate897337
+Node: Getting Accuracy898770
+Node: Try To Round901480
+Node: Setting precision902379
+Ref: table-predefined-precision-strings903076
+Node: Setting the rounding mode904906
+Ref: table-gawk-rounding-modes905280
+Ref: Setting the rounding mode-Footnote-1908688
+Node: Arbitrary Precision Integers908867
+Ref: Arbitrary Precision Integers-Footnote-1911851
+Node: POSIX Floating Point Problems912000
+Ref: POSIX Floating Point Problems-Footnote-1915882
+Node: Floating point summary915920
+Node: Dynamic Extensions918110
+Node: Extension Intro919663
+Node: Plugin License920929
+Node: Extension Mechanism Outline921726
+Ref: figure-load-extension922165
+Ref: figure-register-new-function923730
+Ref: figure-call-new-function924822
+Node: Extension API Description926884
+Node: Extension API Functions Introduction928332
+Node: General Data Types933144
+Ref: General Data Types-Footnote-1939099
+Node: Memory Allocation Functions939398
+Ref: Memory Allocation Functions-Footnote-1942243
+Node: Constructor Functions942342
+Node: Registration Functions944087
+Node: Extension Functions944772
+Node: Exit Callback Functions947071
+Node: Extension Version String948321
+Node: Input Parsers948984
+Node: Output Wrappers958869
+Node: Two-way processors963381
+Node: Printing Messages965645
+Ref: Printing Messages-Footnote-1966719
+Node: Updating ERRNO966872
+Node: Requesting Values967611
+Ref: table-value-types-returned968348
+Node: Accessing Parameters969231
+Node: Symbol Table Access970466
+Node: Symbol table by name970978
+Node: Symbol table by cookie972999
+Ref: Symbol table by cookie-Footnote-1977148
+Node: Cached values977212
+Ref: Cached values-Footnote-1980713
+Node: Array Manipulation980804
+Ref: Array Manipulation-Footnote-1981903
+Node: Array Data Types981940
+Ref: Array Data Types-Footnote-1984598
+Node: Array Functions984690
+Node: Flattening Arrays988548
+Node: Creating Arrays995456
+Node: Extension API Variables1000227
+Node: Extension Versioning1000863
+Node: Extension API Informational Variables1002754
+Node: Extension API Boilerplate1003818
+Node: Finding Extensions1007632
+Node: Extension Example1008191
+Node: Internal File Description1008989
+Node: Internal File Ops1013069
+Ref: Internal File Ops-Footnote-11024831
+Node: Using Internal File Ops1024971
+Ref: Using Internal File Ops-Footnote-11027354
+Node: Extension Samples1027628
+Node: Extension Sample File Functions1029157
+Node: Extension Sample Fnmatch1036806
+Node: Extension Sample Fork1038293
+Node: Extension Sample Inplace1039511
+Node: Extension Sample Ord1042721
+Node: Extension Sample Readdir1043557
+Ref: table-readdir-file-types1044446
+Node: Extension Sample Revout1045251
+Node: Extension Sample Rev2way1045840
+Node: Extension Sample Read write array1046580
+Node: Extension Sample Readfile1048522
+Node: Extension Sample Time1049617
+Node: Extension Sample API Tests1050965
+Node: gawkextlib1051457
+Node: Extension summary1053881
+Node: Extension Exercises1057573
+Node: Language History1059070
+Node: V7/SVR3.11060726
+Node: SVR41062878
+Node: POSIX1064312
+Node: BTL1065691
+Node: POSIX/GNU1066420
+Node: Feature History1071941
+Node: Common Extensions1085270
+Node: Ranges and Locales1086553
+Ref: Ranges and Locales-Footnote-11091169
+Ref: Ranges and Locales-Footnote-21091196
+Ref: Ranges and Locales-Footnote-31091431
+Node: Contributors1091652
+Node: History summary1097221
+Node: Installation1098601
+Node: Gawk Distribution1099545
+Node: Getting1100029
+Node: Extracting1100990
+Node: Distribution contents1102628
+Node: Unix Installation1108379
+Node: Quick Installation1108995
+Node: Additional Configuration Options1111422
+Node: Configuration Philosophy1113226
+Node: Non-Unix Installation1115595
+Node: PC Installation1116053
+Node: PC Binary Installation1117373
+Node: PC Compiling1119225
+Ref: PC Compiling-Footnote-11122249
+Node: PC Testing1122358
+Node: PC Using1123538
+Node: Cygwin1127652
+Node: MSYS1128422
+Node: VMS Installation1128923
+Node: VMS Compilation1129714
+Ref: VMS Compilation-Footnote-11130943
+Node: VMS Dynamic Extensions1131001
+Node: VMS Installation Details1132686
+Node: VMS Running1134939
+Node: VMS GNV1139218
+Node: VMS Old Gawk1139953
+Node: Bugs1140424
+Node: Other Versions1144621
+Node: Installation summary1151205
+Node: Notes1152263
+Node: Compatibility Mode1153128
+Node: Additions1153910
+Node: Accessing The Source1154835
+Node: Adding Code1156270
+Node: New Ports1162489
+Node: Derived Files1166977
+Ref: Derived Files-Footnote-11172462
+Ref: Derived Files-Footnote-21172497
+Ref: Derived Files-Footnote-31173095
+Node: Future Extensions1173209
+Node: Implementation Limitations1173867
+Node: Extension Design1175050
+Node: Old Extension Problems1176204
+Ref: Old Extension Problems-Footnote-11177722
+Node: Extension New Mechanism Goals1177779
+Ref: Extension New Mechanism Goals-Footnote-11181143
+Node: Extension Other Design Decisions1181332
+Node: Extension Future Growth1183445
+Node: Old Extension Mechanism1184281
+Node: Notes summary1186044
+Node: Basic Concepts1187226
+Node: Basic High Level1187907
+Ref: figure-general-flow1188189
+Ref: figure-process-flow1188874
+Ref: Basic High Level-Footnote-11192175
+Node: Basic Data Typing1192360
+Node: Glossary1195688
+Node: Copying1227634
+Node: GNU Free Documentation License1265173
+Node: Index1290291
 
 End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 2c24c8a..8a52338 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -18391,19 +18391,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
address@hidden 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}.
 
address@hidden Table,table-system-return-values
address@hidden values from @code{system()}}
address@hidden @columnfractions .40 .60
address@hidden Situation @tab Return value from @code{system()}
address@hidden @option{--traditional} @tab C @code{system()}'s value divided by 
256
address@hidden @option{--posix} @tab C @code{system()}'s value
address@hidden Normal exit of command @tab Command's exit status
address@hidden Death by signal of command @tab 256 + number of murderous signal
address@hidden Death by signal of command with core dump @tab 512 + number of 
murderous signal
address@hidden Some kind of error @tab @minus{}1
address@hidden multitable
address@hidden float
 @end table
 
 @cindex sidebar, Controlling Output Buffering with @code{system()}
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index c284f84..84b62a4 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
address@hidden 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}.
 
address@hidden Table,table-system-return-values
address@hidden values from @code{system()}}
address@hidden @columnfractions .40 .60
address@hidden Situation @tab Return value from @code{system()}
address@hidden @option{--traditional} @tab C @code{system()}'s value divided by 
256
address@hidden @option{--posix} @tab C @code{system()}'s value
address@hidden Normal exit of command @tab Command's exit status
address@hidden Death by signal of command @tab 256 + number of murderous signal
address@hidden Death by signal of command with core dump @tab 512 + number of 
murderous signal
address@hidden Some kind of error @tab @minus{}1
address@hidden multitable
address@hidden float
 @end table
 
 @sidebar Controlling Output Buffering with @code{system()}

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=8b7c7f8cc2e37a72cd71771575cf2c37a9c8d59d

commit 8b7c7f8cc2e37a72cd71771575cf2c37a9c8d59d
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Mar 10 22:21:11 2016 +0200

    Add info to ChangeLog. Update doc some more.

diff --git a/ChangeLog b/ChangeLog
index deef701..59eff5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-03-10         Arnold D. Robbins     <address@hidden>
+
+       * builtin.c (do_system): Improve return values of system().
+
 2016-03-08         Arnold D. Robbins     <address@hidden>
 
        * profile.c (print_instruction): Fix duplicate case not caught
diff --git a/doc/gawk.info b/doc/gawk.info
index 0a56ebd..f18229b 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12811,12 +12811,12 @@ parameters are enclosed in square brackets ([ ]):
      Traditionally, 'awk''s 'system()' function has simply returned the
      exit status value divided by 256.  In the normal case this gives
      the exit status but in the case of death-by-signal it yields a
-     fractional floating-point value.  POSIX states that 'awk''s
+     fractional floating-point value.(2)  POSIX states that 'awk''s
      'system()' should return the full 16-bit value.
 
      'gawk' steers a middle ground.  By default, it returns just the
      exit status.  The '--traditional' option causes 'gawk' to divide
-     the return vaue by 356, just as Brian Kernighan's 'awk' does.  With
+     the return vaue by 256, just as Brian Kernighan's 'awk' does.  With
      '--posix', it returns the full 16-bit value.
 
      If the process was killed by a signal, 'gawk''s 'system()' returns
@@ -12876,6 +12876,9 @@ would see the latter (undesirable) output.
 terminal device.  On modern systems, this means your keyboard and
 screen.
 
+   (2) In private correspondance, Dr. Kernighan has indicated to me that
+the way this was done was probably a mistake.
+
 
 File: gawk.info,  Node: Time Functions,  Next: Bitwise Functions,  Prev: I/O 
Functions,  Up: Built-in
 
@@ -34899,317 +34902,318 @@ Ref: table-posix-sub537317
 Ref: table-gensub-escapes538858
 Ref: Gory Details-Footnote-1539681
 Node: I/O Functions539832
-Ref: I/O Functions-Footnote-1548337
-Node: Time Functions548485
-Ref: Time Functions-Footnote-1558990
-Ref: Time Functions-Footnote-2559058
-Ref: Time Functions-Footnote-3559216
-Ref: Time Functions-Footnote-4559327
-Ref: Time Functions-Footnote-5559439
-Ref: Time Functions-Footnote-6559666
-Node: Bitwise Functions559932
-Ref: table-bitwise-ops560526
-Ref: Bitwise Functions-Footnote-1564864
-Node: Type Functions565037
-Node: I18N Functions566193
-Node: User-defined567844
-Node: Definition Syntax568649
-Ref: Definition Syntax-Footnote-1574336
-Node: Function Example574407
-Ref: Function Example-Footnote-1577329
-Node: Function Caveats577351
-Node: Calling A Function577869
-Node: Variable Scope578827
-Node: Pass By Value/Reference581821
-Node: Return Statement585320
-Node: Dynamic Typing588299
-Node: Indirect Calls589229
-Ref: Indirect Calls-Footnote-1599480
-Node: Functions Summary599608
-Node: Library Functions602313
-Ref: Library Functions-Footnote-1605920
-Ref: Library Functions-Footnote-2606063
-Node: Library Names606234
-Ref: Library Names-Footnote-1609694
-Ref: Library Names-Footnote-2609917
-Node: General Functions610003
-Node: Strtonum Function611106
-Node: Assert Function614128
-Node: Round Function617454
-Node: Cliff Random Function618995
-Node: Ordinal Functions620011
-Ref: Ordinal Functions-Footnote-1623074
-Ref: Ordinal Functions-Footnote-2623326
-Node: Join Function623536
-Ref: Join Function-Footnote-1625306
-Node: Getlocaltime Function625506
-Node: Readfile Function629248
-Node: Shell Quoting631220
-Node: Data File Management632621
-Node: Filetrans Function633253
-Node: Rewind Function637349
-Node: File Checking639254
-Ref: File Checking-Footnote-1640588
-Node: Empty Files640789
-Node: Ignoring Assigns642768
-Node: Getopt Function644318
-Ref: Getopt Function-Footnote-1655787
-Node: Passwd Functions655987
-Ref: Passwd Functions-Footnote-1664826
-Node: Group Functions664914
-Ref: Group Functions-Footnote-1672811
-Node: Walking Arrays673018
-Node: Library Functions Summary676026
-Node: Library Exercises677432
-Node: Sample Programs677897
-Node: Running Examples678667
-Node: Clones679395
-Node: Cut Program680619
-Node: Egrep Program690548
-Ref: Egrep Program-Footnote-1698060
-Node: Id Program698170
-Node: Split Program701850
-Ref: Split Program-Footnote-1705309
-Node: Tee Program705438
-Node: Uniq Program708228
-Node: Wc Program715654
-Ref: Wc Program-Footnote-1719909
-Node: Miscellaneous Programs720003
-Node: Dupword Program721216
-Node: Alarm Program723246
-Node: Translate Program728101
-Ref: Translate Program-Footnote-1732666
-Node: Labels Program732936
-Ref: Labels Program-Footnote-1736287
-Node: Word Sorting736371
-Node: History Sorting740443
-Node: Extract Program742278
-Node: Simple Sed749807
-Node: Igawk Program752881
-Ref: Igawk Program-Footnote-1767212
-Ref: Igawk Program-Footnote-2767414
-Ref: Igawk Program-Footnote-3767536
-Node: Anagram Program767651
-Node: Signature Program770713
-Node: Programs Summary771960
-Node: Programs Exercises773174
-Ref: Programs Exercises-Footnote-1777303
-Node: Advanced Features777394
-Node: Nondecimal Data779384
-Node: Array Sorting780975
-Node: Controlling Array Traversal781675
-Ref: Controlling Array Traversal-Footnote-1790042
-Node: Array Sorting Functions790160
-Ref: Array Sorting Functions-Footnote-1795251
-Node: Two-way I/O795447
-Ref: Two-way I/O-Footnote-1801267
-Ref: Two-way I/O-Footnote-2801454
-Node: TCP/IP Networking801536
-Node: Profiling804654
-Node: Advanced Features Summary812193
-Node: Internationalization814129
-Node: I18N and L10N815609
-Node: Explaining gettext816296
-Ref: Explaining gettext-Footnote-1821319
-Ref: Explaining gettext-Footnote-2821504
-Node: Programmer i18n821669
-Ref: Programmer i18n-Footnote-1826524
-Node: Translator i18n826573
-Node: String Extraction827367
-Ref: String Extraction-Footnote-1828499
-Node: Printf Ordering828585
-Ref: Printf Ordering-Footnote-1831371
-Node: I18N Portability831435
-Ref: I18N Portability-Footnote-1833891
-Node: I18N Example833954
-Ref: I18N Example-Footnote-1836760
-Node: Gawk I18N836833
-Node: I18N Summary837478
-Node: Debugger838819
-Node: Debugging839841
-Node: Debugging Concepts840282
-Node: Debugging Terms842091
-Node: Awk Debugging844666
-Node: Sample Debugging Session845572
-Node: Debugger Invocation846106
-Node: Finding The Bug847492
-Node: List of Debugger Commands853970
-Node: Breakpoint Control855303
-Node: Debugger Execution Control858997
-Node: Viewing And Changing Data862359
-Node: Execution Stack865733
-Node: Debugger Info867370
-Node: Miscellaneous Debugger Commands871441
-Node: Readline Support876529
-Node: Limitations877425
-Node: Debugging Summary879534
-Node: Arbitrary Precision Arithmetic880707
-Node: Computer Arithmetic882123
-Ref: table-numeric-ranges885714
-Ref: Computer Arithmetic-Footnote-1886436
-Node: Math Definitions886493
-Ref: table-ieee-formats889807
-Ref: Math Definitions-Footnote-1890410
-Node: MPFR features890515
-Node: FP Math Caution892232
-Ref: FP Math Caution-Footnote-1893304
-Node: Inexactness of computations893673
-Node: Inexact representation894633
-Node: Comparing FP Values895993
-Node: Errors accumulate897075
-Node: Getting Accuracy898508
-Node: Try To Round901218
-Node: Setting precision902117
-Ref: table-predefined-precision-strings902814
-Node: Setting the rounding mode904644
-Ref: table-gawk-rounding-modes905018
-Ref: Setting the rounding mode-Footnote-1908426
-Node: Arbitrary Precision Integers908605
-Ref: Arbitrary Precision Integers-Footnote-1911589
-Node: POSIX Floating Point Problems911738
-Ref: POSIX Floating Point Problems-Footnote-1915620
-Node: Floating point summary915658
-Node: Dynamic Extensions917848
-Node: Extension Intro919401
-Node: Plugin License920667
-Node: Extension Mechanism Outline921464
-Ref: figure-load-extension921903
-Ref: figure-register-new-function923468
-Ref: figure-call-new-function924560
-Node: Extension API Description926622
-Node: Extension API Functions Introduction928070
-Node: General Data Types932882
-Ref: General Data Types-Footnote-1938837
-Node: Memory Allocation Functions939136
-Ref: Memory Allocation Functions-Footnote-1941981
-Node: Constructor Functions942080
-Node: Registration Functions943825
-Node: Extension Functions944510
-Node: Exit Callback Functions946809
-Node: Extension Version String948059
-Node: Input Parsers948722
-Node: Output Wrappers958607
-Node: Two-way processors963119
-Node: Printing Messages965383
-Ref: Printing Messages-Footnote-1966457
-Node: Updating ERRNO966610
-Node: Requesting Values967349
-Ref: table-value-types-returned968086
-Node: Accessing Parameters968969
-Node: Symbol Table Access970204
-Node: Symbol table by name970716
-Node: Symbol table by cookie972737
-Ref: Symbol table by cookie-Footnote-1976886
-Node: Cached values976950
-Ref: Cached values-Footnote-1980451
-Node: Array Manipulation980542
-Ref: Array Manipulation-Footnote-1981641
-Node: Array Data Types981678
-Ref: Array Data Types-Footnote-1984336
-Node: Array Functions984428
-Node: Flattening Arrays988286
-Node: Creating Arrays995194
-Node: Extension API Variables999965
-Node: Extension Versioning1000601
-Node: Extension API Informational Variables1002492
-Node: Extension API Boilerplate1003556
-Node: Finding Extensions1007370
-Node: Extension Example1007929
-Node: Internal File Description1008727
-Node: Internal File Ops1012807
-Ref: Internal File Ops-Footnote-11024569
-Node: Using Internal File Ops1024709
-Ref: Using Internal File Ops-Footnote-11027092
-Node: Extension Samples1027366
-Node: Extension Sample File Functions1028895
-Node: Extension Sample Fnmatch1036544
-Node: Extension Sample Fork1038031
-Node: Extension Sample Inplace1039249
-Node: Extension Sample Ord1042459
-Node: Extension Sample Readdir1043295
-Ref: table-readdir-file-types1044184
-Node: Extension Sample Revout1044989
-Node: Extension Sample Rev2way1045578
-Node: Extension Sample Read write array1046318
-Node: Extension Sample Readfile1048260
-Node: Extension Sample Time1049355
-Node: Extension Sample API Tests1050703
-Node: gawkextlib1051195
-Node: Extension summary1053619
-Node: Extension Exercises1057311
-Node: Language History1058808
-Node: V7/SVR3.11060464
-Node: SVR41062616
-Node: POSIX1064050
-Node: BTL1065429
-Node: POSIX/GNU1066158
-Node: Feature History1071679
-Node: Common Extensions1085008
-Node: Ranges and Locales1086291
-Ref: Ranges and Locales-Footnote-11090907
-Ref: Ranges and Locales-Footnote-21090934
-Ref: Ranges and Locales-Footnote-31091169
-Node: Contributors1091390
-Node: History summary1096959
-Node: Installation1098339
-Node: Gawk Distribution1099283
-Node: Getting1099767
-Node: Extracting1100728
-Node: Distribution contents1102366
-Node: Unix Installation1108117
-Node: Quick Installation1108733
-Node: Additional Configuration Options1111160
-Node: Configuration Philosophy1112964
-Node: Non-Unix Installation1115333
-Node: PC Installation1115791
-Node: PC Binary Installation1117111
-Node: PC Compiling1118963
-Ref: PC Compiling-Footnote-11121987
-Node: PC Testing1122096
-Node: PC Using1123276
-Node: Cygwin1127390
-Node: MSYS1128160
-Node: VMS Installation1128661
-Node: VMS Compilation1129452
-Ref: VMS Compilation-Footnote-11130681
-Node: VMS Dynamic Extensions1130739
-Node: VMS Installation Details1132424
-Node: VMS Running1134677
-Node: VMS GNV1138956
-Node: VMS Old Gawk1139691
-Node: Bugs1140162
-Node: Other Versions1144359
-Node: Installation summary1150943
-Node: Notes1152001
-Node: Compatibility Mode1152866
-Node: Additions1153648
-Node: Accessing The Source1154573
-Node: Adding Code1156008
-Node: New Ports1162227
-Node: Derived Files1166715
-Ref: Derived Files-Footnote-11172200
-Ref: Derived Files-Footnote-21172235
-Ref: Derived Files-Footnote-31172833
-Node: Future Extensions1172947
-Node: Implementation Limitations1173605
-Node: Extension Design1174788
-Node: Old Extension Problems1175942
-Ref: Old Extension Problems-Footnote-11177460
-Node: Extension New Mechanism Goals1177517
-Ref: Extension New Mechanism Goals-Footnote-11180881
-Node: Extension Other Design Decisions1181070
-Node: Extension Future Growth1183183
-Node: Old Extension Mechanism1184019
-Node: Notes summary1185782
-Node: Basic Concepts1186964
-Node: Basic High Level1187645
-Ref: figure-general-flow1187927
-Ref: figure-process-flow1188612
-Ref: Basic High Level-Footnote-11191913
-Node: Basic Data Typing1192098
-Node: Glossary1195426
-Node: Copying1227372
-Node: GNU Free Documentation License1264911
-Node: Index1290029
+Ref: I/O Functions-Footnote-1548340
+Ref: I/O Functions-Footnote-2548488
+Node: Time Functions548608
+Ref: Time Functions-Footnote-1559113
+Ref: Time Functions-Footnote-2559181
+Ref: Time Functions-Footnote-3559339
+Ref: Time Functions-Footnote-4559450
+Ref: Time Functions-Footnote-5559562
+Ref: Time Functions-Footnote-6559789
+Node: Bitwise Functions560055
+Ref: table-bitwise-ops560649
+Ref: Bitwise Functions-Footnote-1564987
+Node: Type Functions565160
+Node: I18N Functions566316
+Node: User-defined567967
+Node: Definition Syntax568772
+Ref: Definition Syntax-Footnote-1574459
+Node: Function Example574530
+Ref: Function Example-Footnote-1577452
+Node: Function Caveats577474
+Node: Calling A Function577992
+Node: Variable Scope578950
+Node: Pass By Value/Reference581944
+Node: Return Statement585443
+Node: Dynamic Typing588422
+Node: Indirect Calls589352
+Ref: Indirect Calls-Footnote-1599603
+Node: Functions Summary599731
+Node: Library Functions602436
+Ref: Library Functions-Footnote-1606043
+Ref: Library Functions-Footnote-2606186
+Node: Library Names606357
+Ref: Library Names-Footnote-1609817
+Ref: Library Names-Footnote-2610040
+Node: General Functions610126
+Node: Strtonum Function611229
+Node: Assert Function614251
+Node: Round Function617577
+Node: Cliff Random Function619118
+Node: Ordinal Functions620134
+Ref: Ordinal Functions-Footnote-1623197
+Ref: Ordinal Functions-Footnote-2623449
+Node: Join Function623659
+Ref: Join Function-Footnote-1625429
+Node: Getlocaltime Function625629
+Node: Readfile Function629371
+Node: Shell Quoting631343
+Node: Data File Management632744
+Node: Filetrans Function633376
+Node: Rewind Function637472
+Node: File Checking639377
+Ref: File Checking-Footnote-1640711
+Node: Empty Files640912
+Node: Ignoring Assigns642891
+Node: Getopt Function644441
+Ref: Getopt Function-Footnote-1655910
+Node: Passwd Functions656110
+Ref: Passwd Functions-Footnote-1664949
+Node: Group Functions665037
+Ref: Group Functions-Footnote-1672934
+Node: Walking Arrays673141
+Node: Library Functions Summary676149
+Node: Library Exercises677555
+Node: Sample Programs678020
+Node: Running Examples678790
+Node: Clones679518
+Node: Cut Program680742
+Node: Egrep Program690671
+Ref: Egrep Program-Footnote-1698183
+Node: Id Program698293
+Node: Split Program701973
+Ref: Split Program-Footnote-1705432
+Node: Tee Program705561
+Node: Uniq Program708351
+Node: Wc Program715777
+Ref: Wc Program-Footnote-1720032
+Node: Miscellaneous Programs720126
+Node: Dupword Program721339
+Node: Alarm Program723369
+Node: Translate Program728224
+Ref: Translate Program-Footnote-1732789
+Node: Labels Program733059
+Ref: Labels Program-Footnote-1736410
+Node: Word Sorting736494
+Node: History Sorting740566
+Node: Extract Program742401
+Node: Simple Sed749930
+Node: Igawk Program753004
+Ref: Igawk Program-Footnote-1767335
+Ref: Igawk Program-Footnote-2767537
+Ref: Igawk Program-Footnote-3767659
+Node: Anagram Program767774
+Node: Signature Program770836
+Node: Programs Summary772083
+Node: Programs Exercises773297
+Ref: Programs Exercises-Footnote-1777426
+Node: Advanced Features777517
+Node: Nondecimal Data779507
+Node: Array Sorting781098
+Node: Controlling Array Traversal781798
+Ref: Controlling Array Traversal-Footnote-1790165
+Node: Array Sorting Functions790283
+Ref: Array Sorting Functions-Footnote-1795374
+Node: Two-way I/O795570
+Ref: Two-way I/O-Footnote-1801390
+Ref: Two-way I/O-Footnote-2801577
+Node: TCP/IP Networking801659
+Node: Profiling804777
+Node: Advanced Features Summary812316
+Node: Internationalization814252
+Node: I18N and L10N815732
+Node: Explaining gettext816419
+Ref: Explaining gettext-Footnote-1821442
+Ref: Explaining gettext-Footnote-2821627
+Node: Programmer i18n821792
+Ref: Programmer i18n-Footnote-1826647
+Node: Translator i18n826696
+Node: String Extraction827490
+Ref: String Extraction-Footnote-1828622
+Node: Printf Ordering828708
+Ref: Printf Ordering-Footnote-1831494
+Node: I18N Portability831558
+Ref: I18N Portability-Footnote-1834014
+Node: I18N Example834077
+Ref: I18N Example-Footnote-1836883
+Node: Gawk I18N836956
+Node: I18N Summary837601
+Node: Debugger838942
+Node: Debugging839964
+Node: Debugging Concepts840405
+Node: Debugging Terms842214
+Node: Awk Debugging844789
+Node: Sample Debugging Session845695
+Node: Debugger Invocation846229
+Node: Finding The Bug847615
+Node: List of Debugger Commands854093
+Node: Breakpoint Control855426
+Node: Debugger Execution Control859120
+Node: Viewing And Changing Data862482
+Node: Execution Stack865856
+Node: Debugger Info867493
+Node: Miscellaneous Debugger Commands871564
+Node: Readline Support876652
+Node: Limitations877548
+Node: Debugging Summary879657
+Node: Arbitrary Precision Arithmetic880830
+Node: Computer Arithmetic882246
+Ref: table-numeric-ranges885837
+Ref: Computer Arithmetic-Footnote-1886559
+Node: Math Definitions886616
+Ref: table-ieee-formats889930
+Ref: Math Definitions-Footnote-1890533
+Node: MPFR features890638
+Node: FP Math Caution892355
+Ref: FP Math Caution-Footnote-1893427
+Node: Inexactness of computations893796
+Node: Inexact representation894756
+Node: Comparing FP Values896116
+Node: Errors accumulate897198
+Node: Getting Accuracy898631
+Node: Try To Round901341
+Node: Setting precision902240
+Ref: table-predefined-precision-strings902937
+Node: Setting the rounding mode904767
+Ref: table-gawk-rounding-modes905141
+Ref: Setting the rounding mode-Footnote-1908549
+Node: Arbitrary Precision Integers908728
+Ref: Arbitrary Precision Integers-Footnote-1911712
+Node: POSIX Floating Point Problems911861
+Ref: POSIX Floating Point Problems-Footnote-1915743
+Node: Floating point summary915781
+Node: Dynamic Extensions917971
+Node: Extension Intro919524
+Node: Plugin License920790
+Node: Extension Mechanism Outline921587
+Ref: figure-load-extension922026
+Ref: figure-register-new-function923591
+Ref: figure-call-new-function924683
+Node: Extension API Description926745
+Node: Extension API Functions Introduction928193
+Node: General Data Types933005
+Ref: General Data Types-Footnote-1938960
+Node: Memory Allocation Functions939259
+Ref: Memory Allocation Functions-Footnote-1942104
+Node: Constructor Functions942203
+Node: Registration Functions943948
+Node: Extension Functions944633
+Node: Exit Callback Functions946932
+Node: Extension Version String948182
+Node: Input Parsers948845
+Node: Output Wrappers958730
+Node: Two-way processors963242
+Node: Printing Messages965506
+Ref: Printing Messages-Footnote-1966580
+Node: Updating ERRNO966733
+Node: Requesting Values967472
+Ref: table-value-types-returned968209
+Node: Accessing Parameters969092
+Node: Symbol Table Access970327
+Node: Symbol table by name970839
+Node: Symbol table by cookie972860
+Ref: Symbol table by cookie-Footnote-1977009
+Node: Cached values977073
+Ref: Cached values-Footnote-1980574
+Node: Array Manipulation980665
+Ref: Array Manipulation-Footnote-1981764
+Node: Array Data Types981801
+Ref: Array Data Types-Footnote-1984459
+Node: Array Functions984551
+Node: Flattening Arrays988409
+Node: Creating Arrays995317
+Node: Extension API Variables1000088
+Node: Extension Versioning1000724
+Node: Extension API Informational Variables1002615
+Node: Extension API Boilerplate1003679
+Node: Finding Extensions1007493
+Node: Extension Example1008052
+Node: Internal File Description1008850
+Node: Internal File Ops1012930
+Ref: Internal File Ops-Footnote-11024692
+Node: Using Internal File Ops1024832
+Ref: Using Internal File Ops-Footnote-11027215
+Node: Extension Samples1027489
+Node: Extension Sample File Functions1029018
+Node: Extension Sample Fnmatch1036667
+Node: Extension Sample Fork1038154
+Node: Extension Sample Inplace1039372
+Node: Extension Sample Ord1042582
+Node: Extension Sample Readdir1043418
+Ref: table-readdir-file-types1044307
+Node: Extension Sample Revout1045112
+Node: Extension Sample Rev2way1045701
+Node: Extension Sample Read write array1046441
+Node: Extension Sample Readfile1048383
+Node: Extension Sample Time1049478
+Node: Extension Sample API Tests1050826
+Node: gawkextlib1051318
+Node: Extension summary1053742
+Node: Extension Exercises1057434
+Node: Language History1058931
+Node: V7/SVR3.11060587
+Node: SVR41062739
+Node: POSIX1064173
+Node: BTL1065552
+Node: POSIX/GNU1066281
+Node: Feature History1071802
+Node: Common Extensions1085131
+Node: Ranges and Locales1086414
+Ref: Ranges and Locales-Footnote-11091030
+Ref: Ranges and Locales-Footnote-21091057
+Ref: Ranges and Locales-Footnote-31091292
+Node: Contributors1091513
+Node: History summary1097082
+Node: Installation1098462
+Node: Gawk Distribution1099406
+Node: Getting1099890
+Node: Extracting1100851
+Node: Distribution contents1102489
+Node: Unix Installation1108240
+Node: Quick Installation1108856
+Node: Additional Configuration Options1111283
+Node: Configuration Philosophy1113087
+Node: Non-Unix Installation1115456
+Node: PC Installation1115914
+Node: PC Binary Installation1117234
+Node: PC Compiling1119086
+Ref: PC Compiling-Footnote-11122110
+Node: PC Testing1122219
+Node: PC Using1123399
+Node: Cygwin1127513
+Node: MSYS1128283
+Node: VMS Installation1128784
+Node: VMS Compilation1129575
+Ref: VMS Compilation-Footnote-11130804
+Node: VMS Dynamic Extensions1130862
+Node: VMS Installation Details1132547
+Node: VMS Running1134800
+Node: VMS GNV1139079
+Node: VMS Old Gawk1139814
+Node: Bugs1140285
+Node: Other Versions1144482
+Node: Installation summary1151066
+Node: Notes1152124
+Node: Compatibility Mode1152989
+Node: Additions1153771
+Node: Accessing The Source1154696
+Node: Adding Code1156131
+Node: New Ports1162350
+Node: Derived Files1166838
+Ref: Derived Files-Footnote-11172323
+Ref: Derived Files-Footnote-21172358
+Ref: Derived Files-Footnote-31172956
+Node: Future Extensions1173070
+Node: Implementation Limitations1173728
+Node: Extension Design1174911
+Node: Old Extension Problems1176065
+Ref: Old Extension Problems-Footnote-11177583
+Node: Extension New Mechanism Goals1177640
+Ref: Extension New Mechanism Goals-Footnote-11181004
+Node: Extension Other Design Decisions1181193
+Node: Extension Future Growth1183306
+Node: Old Extension Mechanism1184142
+Node: Notes summary1185905
+Node: Basic Concepts1187087
+Node: Basic High Level1187768
+Ref: figure-general-flow1188050
+Ref: figure-process-flow1188735
+Ref: Basic High Level-Footnote-11192036
+Node: Basic Data Typing1192221
+Node: Glossary1195549
+Node: Copying1227495
+Node: GNU Free Documentation License1265034
+Node: Index1290152
 
 End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 3082689..2c24c8a 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -18385,13 +18385,15 @@ signal (bit 7) and if so, the guilty signal number 
(bits 0--6).
 Traditionally, @command{awk}'s @code{system()} function has simply
 returned the exit status value divided by 256. In the normal case this
 gives the exit status but in the case of death-by-signal it yields
-a fractional floating-point value. POSIX states that @command{awk}'s
+a fractional floating-point address@hidden private correspondance,
+Dr.@: Kernighan has indicated to me that the way this was done
+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 356, just as Brian Kernighan's @command{awk} does.
+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()}
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 3831d6e..c284f84 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -17577,13 +17577,15 @@ signal (bit 7) and if so, the guilty signal number 
(bits 0--6).
 Traditionally, @command{awk}'s @code{system()} function has simply
 returned the exit status value divided by 256. In the normal case this
 gives the exit status but in the case of death-by-signal it yields
-a fractional floating-point value. POSIX states that @command{awk}'s
+a fractional floating-point address@hidden private correspondance,
+Dr.@: Kernighan has indicated to me that the way this was done
+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 356, just as Brian Kernighan's @command{awk} does.
+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()}

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=3952172ea5f501a92c4ccf8595ebaee34d29377d

commit 3952172ea5f501a92c4ccf8595ebaee34d29377d
Author: Arnold D. Robbins <address@hidden>
Date:   Tue Mar 8 22:39:57 2016 +0200

    Improve algorithm for system() return value.

diff --git a/builtin.c b/builtin.c
index 375497f..da664e3 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2061,7 +2061,7 @@ NODE *
 do_system(int nargs)
 {
        NODE *tmp;
-       int ret = 0;
+       AWKNUM ret = 0;         /* floating point on purpose, compat Unix awk */
        char *cmd;
        char save;
 
@@ -2084,17 +2084,17 @@ do_system(int nargs)
                /*
                 * 3/2016. What to do with ret? It's never simple.
                 * POSIX says to use the full return value. BWK awk
-                * uses just the exit status. That seems more useful to
-                * me, but then death by signal info gets lost.
+                * divides the result by 256.  That normally gives the
+                * exit status but gives a weird result for death-by-signal.
                 * So we compromise as follows:
                 */
                if (ret != -1) {
                        if (do_posix)
                                ;       /* leave it alone, full 16 bits */
+                       else if (do_traditional)
+                               ret /= 256.0;
                        else if (WIFEXITED(ret))
                                ret = WEXITSTATUS(ret); /* normal exit */
-                       else if (do_traditional)
-                               ret = 0;        /* ignore signal death */
                        else if (WIFSIGNALED(ret))
                                /* use 256 since exit values are 8 bits */
                                ret = WTERMSIG(ret) + 256;
diff --git a/doc/gawk.info b/doc/gawk.info
index 3820a05..0a56ebd 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12805,17 +12805,19 @@ parameters are enclosed in square brackets ([ ]):
      On POSIX systems, a command's exit status is a 16-bit number.  The
      exit value passed to the C 'exit()' function is held in the
      high-order eight bits.  The low-order bits indicate if the process
-     was killed by a signal (bit 7) and if so, the signal number (bits
-     0-6).
+     was killed by a signal (bit 7) and if so, the guilty signal number
+     (bits 0-6).
 
      Traditionally, 'awk''s 'system()' function has simply returned the
-     exit status value and ignored death-by-signal.  POSIX states that
-     'awk''s 'system()' should return the full 16-bit value.
+     exit status value divided by 256.  In the normal case this gives
+     the exit status but in the case of death-by-signal it yields a
+     fractional floating-point value.  POSIX states that 'awk''s
+     'system()' should return the full 16-bit value.
 
-     'gawk' steers a middle ground.  With '--posix', it returns the full
-     16-bit value.  By default, it returns just the exit status.  The
-     '--traditional' option forces 'gawk' to ignore death-by-signal, in
-     which case 'system()' returns zero.
+     'gawk' steers a middle ground.  By default, it returns just the
+     exit status.  The '--traditional' option causes 'gawk' to divide
+     the return vaue by 356, just as Brian Kernighan's 'awk' does.  With
+     '--posix', it returns the full 16-bit value.
 
      If the process was killed by a signal, 'gawk''s 'system()' returns
      256 + SIG, where SIG is the number of the signal that killed the
@@ -32218,11 +32220,11 @@ Index
 * Buening, Andreas:                      Acknowledgments.     (line  60)
 * Buening, Andreas <1>:                  Contributors.        (line  93)
 * Buening, Andreas <2>:                  Bugs.                (line  73)
-* buffering, input/output:               I/O Functions.       (line 162)
+* buffering, input/output:               I/O Functions.       (line 164)
 * buffering, input/output <1>:           Two-way I/O.         (line  53)
 * buffering, interactive vs. noninteractive: I/O Functions.   (line  76)
 * buffers, flushing:                     I/O Functions.       (line  32)
-* buffers, flushing <1>:                 I/O Functions.       (line 162)
+* buffers, flushing <1>:                 I/O Functions.       (line 164)
 * buffers, operators for:                GNU Regexp Operators.
                                                               (line  51)
 * bug reports, email address, address@hidden: Bugs.         (line  30)
@@ -33746,7 +33748,7 @@ Index
 * output redirection:                    Redirection.         (line   6)
 * output wrapper:                        Output Wrappers.     (line   6)
 * output, buffering:                     I/O Functions.       (line  32)
-* output, buffering <1>:                 I/O Functions.       (line 162)
+* output, buffering <1>:                 I/O Functions.       (line 164)
 * output, duplicating into files:        Tee Program.         (line   6)
 * output, files, closing:                Close Files And Pipes.
                                                               (line   6)
@@ -34242,7 +34244,7 @@ Index
                                                               (line  14)
 * sidebar, Changing NR and FNR:          Auto-set.            (line 311)
 * sidebar, Controlling Output Buffering with system(): I/O Functions.
-                                                              (line 160)
+                                                              (line 162)
 * sidebar, Escape Sequences for Metacharacters: Escape Sequences.
                                                               (line 135)
 * sidebar, FS and IGNORECASE:            Field Splitting Summary.
@@ -34897,317 +34899,317 @@ Ref: table-posix-sub537317
 Ref: table-gensub-escapes538858
 Ref: Gory Details-Footnote-1539681
 Node: I/O Functions539832
-Ref: I/O Functions-Footnote-1548200
-Node: Time Functions548348
-Ref: Time Functions-Footnote-1558853
-Ref: Time Functions-Footnote-2558921
-Ref: Time Functions-Footnote-3559079
-Ref: Time Functions-Footnote-4559190
-Ref: Time Functions-Footnote-5559302
-Ref: Time Functions-Footnote-6559529
-Node: Bitwise Functions559795
-Ref: table-bitwise-ops560389
-Ref: Bitwise Functions-Footnote-1564727
-Node: Type Functions564900
-Node: I18N Functions566056
-Node: User-defined567707
-Node: Definition Syntax568512
-Ref: Definition Syntax-Footnote-1574199
-Node: Function Example574270
-Ref: Function Example-Footnote-1577192
-Node: Function Caveats577214
-Node: Calling A Function577732
-Node: Variable Scope578690
-Node: Pass By Value/Reference581684
-Node: Return Statement585183
-Node: Dynamic Typing588162
-Node: Indirect Calls589092
-Ref: Indirect Calls-Footnote-1599343
-Node: Functions Summary599471
-Node: Library Functions602176
-Ref: Library Functions-Footnote-1605783
-Ref: Library Functions-Footnote-2605926
-Node: Library Names606097
-Ref: Library Names-Footnote-1609557
-Ref: Library Names-Footnote-2609780
-Node: General Functions609866
-Node: Strtonum Function610969
-Node: Assert Function613991
-Node: Round Function617317
-Node: Cliff Random Function618858
-Node: Ordinal Functions619874
-Ref: Ordinal Functions-Footnote-1622937
-Ref: Ordinal Functions-Footnote-2623189
-Node: Join Function623399
-Ref: Join Function-Footnote-1625169
-Node: Getlocaltime Function625369
-Node: Readfile Function629111
-Node: Shell Quoting631083
-Node: Data File Management632484
-Node: Filetrans Function633116
-Node: Rewind Function637212
-Node: File Checking639117
-Ref: File Checking-Footnote-1640451
-Node: Empty Files640652
-Node: Ignoring Assigns642631
-Node: Getopt Function644181
-Ref: Getopt Function-Footnote-1655650
-Node: Passwd Functions655850
-Ref: Passwd Functions-Footnote-1664689
-Node: Group Functions664777
-Ref: Group Functions-Footnote-1672674
-Node: Walking Arrays672881
-Node: Library Functions Summary675889
-Node: Library Exercises677295
-Node: Sample Programs677760
-Node: Running Examples678530
-Node: Clones679258
-Node: Cut Program680482
-Node: Egrep Program690411
-Ref: Egrep Program-Footnote-1697923
-Node: Id Program698033
-Node: Split Program701713
-Ref: Split Program-Footnote-1705172
-Node: Tee Program705301
-Node: Uniq Program708091
-Node: Wc Program715517
-Ref: Wc Program-Footnote-1719772
-Node: Miscellaneous Programs719866
-Node: Dupword Program721079
-Node: Alarm Program723109
-Node: Translate Program727964
-Ref: Translate Program-Footnote-1732529
-Node: Labels Program732799
-Ref: Labels Program-Footnote-1736150
-Node: Word Sorting736234
-Node: History Sorting740306
-Node: Extract Program742141
-Node: Simple Sed749670
-Node: Igawk Program752744
-Ref: Igawk Program-Footnote-1767075
-Ref: Igawk Program-Footnote-2767277
-Ref: Igawk Program-Footnote-3767399
-Node: Anagram Program767514
-Node: Signature Program770576
-Node: Programs Summary771823
-Node: Programs Exercises773037
-Ref: Programs Exercises-Footnote-1777166
-Node: Advanced Features777257
-Node: Nondecimal Data779247
-Node: Array Sorting780838
-Node: Controlling Array Traversal781538
-Ref: Controlling Array Traversal-Footnote-1789905
-Node: Array Sorting Functions790023
-Ref: Array Sorting Functions-Footnote-1795114
-Node: Two-way I/O795310
-Ref: Two-way I/O-Footnote-1801130
-Ref: Two-way I/O-Footnote-2801317
-Node: TCP/IP Networking801399
-Node: Profiling804517
-Node: Advanced Features Summary812056
-Node: Internationalization813992
-Node: I18N and L10N815472
-Node: Explaining gettext816159
-Ref: Explaining gettext-Footnote-1821182
-Ref: Explaining gettext-Footnote-2821367
-Node: Programmer i18n821532
-Ref: Programmer i18n-Footnote-1826387
-Node: Translator i18n826436
-Node: String Extraction827230
-Ref: String Extraction-Footnote-1828362
-Node: Printf Ordering828448
-Ref: Printf Ordering-Footnote-1831234
-Node: I18N Portability831298
-Ref: I18N Portability-Footnote-1833754
-Node: I18N Example833817
-Ref: I18N Example-Footnote-1836623
-Node: Gawk I18N836696
-Node: I18N Summary837341
-Node: Debugger838682
-Node: Debugging839704
-Node: Debugging Concepts840145
-Node: Debugging Terms841954
-Node: Awk Debugging844529
-Node: Sample Debugging Session845435
-Node: Debugger Invocation845969
-Node: Finding The Bug847355
-Node: List of Debugger Commands853833
-Node: Breakpoint Control855166
-Node: Debugger Execution Control858860
-Node: Viewing And Changing Data862222
-Node: Execution Stack865596
-Node: Debugger Info867233
-Node: Miscellaneous Debugger Commands871304
-Node: Readline Support876392
-Node: Limitations877288
-Node: Debugging Summary879397
-Node: Arbitrary Precision Arithmetic880570
-Node: Computer Arithmetic881986
-Ref: table-numeric-ranges885577
-Ref: Computer Arithmetic-Footnote-1886299
-Node: Math Definitions886356
-Ref: table-ieee-formats889670
-Ref: Math Definitions-Footnote-1890273
-Node: MPFR features890378
-Node: FP Math Caution892095
-Ref: FP Math Caution-Footnote-1893167
-Node: Inexactness of computations893536
-Node: Inexact representation894496
-Node: Comparing FP Values895856
-Node: Errors accumulate896938
-Node: Getting Accuracy898371
-Node: Try To Round901081
-Node: Setting precision901980
-Ref: table-predefined-precision-strings902677
-Node: Setting the rounding mode904507
-Ref: table-gawk-rounding-modes904881
-Ref: Setting the rounding mode-Footnote-1908289
-Node: Arbitrary Precision Integers908468
-Ref: Arbitrary Precision Integers-Footnote-1911452
-Node: POSIX Floating Point Problems911601
-Ref: POSIX Floating Point Problems-Footnote-1915483
-Node: Floating point summary915521
-Node: Dynamic Extensions917711
-Node: Extension Intro919264
-Node: Plugin License920530
-Node: Extension Mechanism Outline921327
-Ref: figure-load-extension921766
-Ref: figure-register-new-function923331
-Ref: figure-call-new-function924423
-Node: Extension API Description926485
-Node: Extension API Functions Introduction927933
-Node: General Data Types932745
-Ref: General Data Types-Footnote-1938700
-Node: Memory Allocation Functions938999
-Ref: Memory Allocation Functions-Footnote-1941844
-Node: Constructor Functions941943
-Node: Registration Functions943688
-Node: Extension Functions944373
-Node: Exit Callback Functions946672
-Node: Extension Version String947922
-Node: Input Parsers948585
-Node: Output Wrappers958470
-Node: Two-way processors962982
-Node: Printing Messages965246
-Ref: Printing Messages-Footnote-1966320
-Node: Updating ERRNO966473
-Node: Requesting Values967212
-Ref: table-value-types-returned967949
-Node: Accessing Parameters968832
-Node: Symbol Table Access970067
-Node: Symbol table by name970579
-Node: Symbol table by cookie972600
-Ref: Symbol table by cookie-Footnote-1976749
-Node: Cached values976813
-Ref: Cached values-Footnote-1980314
-Node: Array Manipulation980405
-Ref: Array Manipulation-Footnote-1981504
-Node: Array Data Types981541
-Ref: Array Data Types-Footnote-1984199
-Node: Array Functions984291
-Node: Flattening Arrays988149
-Node: Creating Arrays995057
-Node: Extension API Variables999828
-Node: Extension Versioning1000464
-Node: Extension API Informational Variables1002355
-Node: Extension API Boilerplate1003419
-Node: Finding Extensions1007233
-Node: Extension Example1007792
-Node: Internal File Description1008590
-Node: Internal File Ops1012670
-Ref: Internal File Ops-Footnote-11024432
-Node: Using Internal File Ops1024572
-Ref: Using Internal File Ops-Footnote-11026955
-Node: Extension Samples1027229
-Node: Extension Sample File Functions1028758
-Node: Extension Sample Fnmatch1036407
-Node: Extension Sample Fork1037894
-Node: Extension Sample Inplace1039112
-Node: Extension Sample Ord1042322
-Node: Extension Sample Readdir1043158
-Ref: table-readdir-file-types1044047
-Node: Extension Sample Revout1044852
-Node: Extension Sample Rev2way1045441
-Node: Extension Sample Read write array1046181
-Node: Extension Sample Readfile1048123
-Node: Extension Sample Time1049218
-Node: Extension Sample API Tests1050566
-Node: gawkextlib1051058
-Node: Extension summary1053482
-Node: Extension Exercises1057174
-Node: Language History1058671
-Node: V7/SVR3.11060327
-Node: SVR41062479
-Node: POSIX1063913
-Node: BTL1065292
-Node: POSIX/GNU1066021
-Node: Feature History1071542
-Node: Common Extensions1084871
-Node: Ranges and Locales1086154
-Ref: Ranges and Locales-Footnote-11090770
-Ref: Ranges and Locales-Footnote-21090797
-Ref: Ranges and Locales-Footnote-31091032
-Node: Contributors1091253
-Node: History summary1096822
-Node: Installation1098202
-Node: Gawk Distribution1099146
-Node: Getting1099630
-Node: Extracting1100591
-Node: Distribution contents1102229
-Node: Unix Installation1107980
-Node: Quick Installation1108596
-Node: Additional Configuration Options1111023
-Node: Configuration Philosophy1112827
-Node: Non-Unix Installation1115196
-Node: PC Installation1115654
-Node: PC Binary Installation1116974
-Node: PC Compiling1118826
-Ref: PC Compiling-Footnote-11121850
-Node: PC Testing1121959
-Node: PC Using1123139
-Node: Cygwin1127253
-Node: MSYS1128023
-Node: VMS Installation1128524
-Node: VMS Compilation1129315
-Ref: VMS Compilation-Footnote-11130544
-Node: VMS Dynamic Extensions1130602
-Node: VMS Installation Details1132287
-Node: VMS Running1134540
-Node: VMS GNV1138819
-Node: VMS Old Gawk1139554
-Node: Bugs1140025
-Node: Other Versions1144222
-Node: Installation summary1150806
-Node: Notes1151864
-Node: Compatibility Mode1152729
-Node: Additions1153511
-Node: Accessing The Source1154436
-Node: Adding Code1155871
-Node: New Ports1162090
-Node: Derived Files1166578
-Ref: Derived Files-Footnote-11172063
-Ref: Derived Files-Footnote-21172098
-Ref: Derived Files-Footnote-31172696
-Node: Future Extensions1172810
-Node: Implementation Limitations1173468
-Node: Extension Design1174651
-Node: Old Extension Problems1175805
-Ref: Old Extension Problems-Footnote-11177323
-Node: Extension New Mechanism Goals1177380
-Ref: Extension New Mechanism Goals-Footnote-11180744
-Node: Extension Other Design Decisions1180933
-Node: Extension Future Growth1183046
-Node: Old Extension Mechanism1183882
-Node: Notes summary1185645
-Node: Basic Concepts1186827
-Node: Basic High Level1187508
-Ref: figure-general-flow1187790
-Ref: figure-process-flow1188475
-Ref: Basic High Level-Footnote-11191776
-Node: Basic Data Typing1191961
-Node: Glossary1195289
-Node: Copying1227235
-Node: GNU Free Documentation License1264774
-Node: Index1289892
+Ref: I/O Functions-Footnote-1548337
+Node: Time Functions548485
+Ref: Time Functions-Footnote-1558990
+Ref: Time Functions-Footnote-2559058
+Ref: Time Functions-Footnote-3559216
+Ref: Time Functions-Footnote-4559327
+Ref: Time Functions-Footnote-5559439
+Ref: Time Functions-Footnote-6559666
+Node: Bitwise Functions559932
+Ref: table-bitwise-ops560526
+Ref: Bitwise Functions-Footnote-1564864
+Node: Type Functions565037
+Node: I18N Functions566193
+Node: User-defined567844
+Node: Definition Syntax568649
+Ref: Definition Syntax-Footnote-1574336
+Node: Function Example574407
+Ref: Function Example-Footnote-1577329
+Node: Function Caveats577351
+Node: Calling A Function577869
+Node: Variable Scope578827
+Node: Pass By Value/Reference581821
+Node: Return Statement585320
+Node: Dynamic Typing588299
+Node: Indirect Calls589229
+Ref: Indirect Calls-Footnote-1599480
+Node: Functions Summary599608
+Node: Library Functions602313
+Ref: Library Functions-Footnote-1605920
+Ref: Library Functions-Footnote-2606063
+Node: Library Names606234
+Ref: Library Names-Footnote-1609694
+Ref: Library Names-Footnote-2609917
+Node: General Functions610003
+Node: Strtonum Function611106
+Node: Assert Function614128
+Node: Round Function617454
+Node: Cliff Random Function618995
+Node: Ordinal Functions620011
+Ref: Ordinal Functions-Footnote-1623074
+Ref: Ordinal Functions-Footnote-2623326
+Node: Join Function623536
+Ref: Join Function-Footnote-1625306
+Node: Getlocaltime Function625506
+Node: Readfile Function629248
+Node: Shell Quoting631220
+Node: Data File Management632621
+Node: Filetrans Function633253
+Node: Rewind Function637349
+Node: File Checking639254
+Ref: File Checking-Footnote-1640588
+Node: Empty Files640789
+Node: Ignoring Assigns642768
+Node: Getopt Function644318
+Ref: Getopt Function-Footnote-1655787
+Node: Passwd Functions655987
+Ref: Passwd Functions-Footnote-1664826
+Node: Group Functions664914
+Ref: Group Functions-Footnote-1672811
+Node: Walking Arrays673018
+Node: Library Functions Summary676026
+Node: Library Exercises677432
+Node: Sample Programs677897
+Node: Running Examples678667
+Node: Clones679395
+Node: Cut Program680619
+Node: Egrep Program690548
+Ref: Egrep Program-Footnote-1698060
+Node: Id Program698170
+Node: Split Program701850
+Ref: Split Program-Footnote-1705309
+Node: Tee Program705438
+Node: Uniq Program708228
+Node: Wc Program715654
+Ref: Wc Program-Footnote-1719909
+Node: Miscellaneous Programs720003
+Node: Dupword Program721216
+Node: Alarm Program723246
+Node: Translate Program728101
+Ref: Translate Program-Footnote-1732666
+Node: Labels Program732936
+Ref: Labels Program-Footnote-1736287
+Node: Word Sorting736371
+Node: History Sorting740443
+Node: Extract Program742278
+Node: Simple Sed749807
+Node: Igawk Program752881
+Ref: Igawk Program-Footnote-1767212
+Ref: Igawk Program-Footnote-2767414
+Ref: Igawk Program-Footnote-3767536
+Node: Anagram Program767651
+Node: Signature Program770713
+Node: Programs Summary771960
+Node: Programs Exercises773174
+Ref: Programs Exercises-Footnote-1777303
+Node: Advanced Features777394
+Node: Nondecimal Data779384
+Node: Array Sorting780975
+Node: Controlling Array Traversal781675
+Ref: Controlling Array Traversal-Footnote-1790042
+Node: Array Sorting Functions790160
+Ref: Array Sorting Functions-Footnote-1795251
+Node: Two-way I/O795447
+Ref: Two-way I/O-Footnote-1801267
+Ref: Two-way I/O-Footnote-2801454
+Node: TCP/IP Networking801536
+Node: Profiling804654
+Node: Advanced Features Summary812193
+Node: Internationalization814129
+Node: I18N and L10N815609
+Node: Explaining gettext816296
+Ref: Explaining gettext-Footnote-1821319
+Ref: Explaining gettext-Footnote-2821504
+Node: Programmer i18n821669
+Ref: Programmer i18n-Footnote-1826524
+Node: Translator i18n826573
+Node: String Extraction827367
+Ref: String Extraction-Footnote-1828499
+Node: Printf Ordering828585
+Ref: Printf Ordering-Footnote-1831371
+Node: I18N Portability831435
+Ref: I18N Portability-Footnote-1833891
+Node: I18N Example833954
+Ref: I18N Example-Footnote-1836760
+Node: Gawk I18N836833
+Node: I18N Summary837478
+Node: Debugger838819
+Node: Debugging839841
+Node: Debugging Concepts840282
+Node: Debugging Terms842091
+Node: Awk Debugging844666
+Node: Sample Debugging Session845572
+Node: Debugger Invocation846106
+Node: Finding The Bug847492
+Node: List of Debugger Commands853970
+Node: Breakpoint Control855303
+Node: Debugger Execution Control858997
+Node: Viewing And Changing Data862359
+Node: Execution Stack865733
+Node: Debugger Info867370
+Node: Miscellaneous Debugger Commands871441
+Node: Readline Support876529
+Node: Limitations877425
+Node: Debugging Summary879534
+Node: Arbitrary Precision Arithmetic880707
+Node: Computer Arithmetic882123
+Ref: table-numeric-ranges885714
+Ref: Computer Arithmetic-Footnote-1886436
+Node: Math Definitions886493
+Ref: table-ieee-formats889807
+Ref: Math Definitions-Footnote-1890410
+Node: MPFR features890515
+Node: FP Math Caution892232
+Ref: FP Math Caution-Footnote-1893304
+Node: Inexactness of computations893673
+Node: Inexact representation894633
+Node: Comparing FP Values895993
+Node: Errors accumulate897075
+Node: Getting Accuracy898508
+Node: Try To Round901218
+Node: Setting precision902117
+Ref: table-predefined-precision-strings902814
+Node: Setting the rounding mode904644
+Ref: table-gawk-rounding-modes905018
+Ref: Setting the rounding mode-Footnote-1908426
+Node: Arbitrary Precision Integers908605
+Ref: Arbitrary Precision Integers-Footnote-1911589
+Node: POSIX Floating Point Problems911738
+Ref: POSIX Floating Point Problems-Footnote-1915620
+Node: Floating point summary915658
+Node: Dynamic Extensions917848
+Node: Extension Intro919401
+Node: Plugin License920667
+Node: Extension Mechanism Outline921464
+Ref: figure-load-extension921903
+Ref: figure-register-new-function923468
+Ref: figure-call-new-function924560
+Node: Extension API Description926622
+Node: Extension API Functions Introduction928070
+Node: General Data Types932882
+Ref: General Data Types-Footnote-1938837
+Node: Memory Allocation Functions939136
+Ref: Memory Allocation Functions-Footnote-1941981
+Node: Constructor Functions942080
+Node: Registration Functions943825
+Node: Extension Functions944510
+Node: Exit Callback Functions946809
+Node: Extension Version String948059
+Node: Input Parsers948722
+Node: Output Wrappers958607
+Node: Two-way processors963119
+Node: Printing Messages965383
+Ref: Printing Messages-Footnote-1966457
+Node: Updating ERRNO966610
+Node: Requesting Values967349
+Ref: table-value-types-returned968086
+Node: Accessing Parameters968969
+Node: Symbol Table Access970204
+Node: Symbol table by name970716
+Node: Symbol table by cookie972737
+Ref: Symbol table by cookie-Footnote-1976886
+Node: Cached values976950
+Ref: Cached values-Footnote-1980451
+Node: Array Manipulation980542
+Ref: Array Manipulation-Footnote-1981641
+Node: Array Data Types981678
+Ref: Array Data Types-Footnote-1984336
+Node: Array Functions984428
+Node: Flattening Arrays988286
+Node: Creating Arrays995194
+Node: Extension API Variables999965
+Node: Extension Versioning1000601
+Node: Extension API Informational Variables1002492
+Node: Extension API Boilerplate1003556
+Node: Finding Extensions1007370
+Node: Extension Example1007929
+Node: Internal File Description1008727
+Node: Internal File Ops1012807
+Ref: Internal File Ops-Footnote-11024569
+Node: Using Internal File Ops1024709
+Ref: Using Internal File Ops-Footnote-11027092
+Node: Extension Samples1027366
+Node: Extension Sample File Functions1028895
+Node: Extension Sample Fnmatch1036544
+Node: Extension Sample Fork1038031
+Node: Extension Sample Inplace1039249
+Node: Extension Sample Ord1042459
+Node: Extension Sample Readdir1043295
+Ref: table-readdir-file-types1044184
+Node: Extension Sample Revout1044989
+Node: Extension Sample Rev2way1045578
+Node: Extension Sample Read write array1046318
+Node: Extension Sample Readfile1048260
+Node: Extension Sample Time1049355
+Node: Extension Sample API Tests1050703
+Node: gawkextlib1051195
+Node: Extension summary1053619
+Node: Extension Exercises1057311
+Node: Language History1058808
+Node: V7/SVR3.11060464
+Node: SVR41062616
+Node: POSIX1064050
+Node: BTL1065429
+Node: POSIX/GNU1066158
+Node: Feature History1071679
+Node: Common Extensions1085008
+Node: Ranges and Locales1086291
+Ref: Ranges and Locales-Footnote-11090907
+Ref: Ranges and Locales-Footnote-21090934
+Ref: Ranges and Locales-Footnote-31091169
+Node: Contributors1091390
+Node: History summary1096959
+Node: Installation1098339
+Node: Gawk Distribution1099283
+Node: Getting1099767
+Node: Extracting1100728
+Node: Distribution contents1102366
+Node: Unix Installation1108117
+Node: Quick Installation1108733
+Node: Additional Configuration Options1111160
+Node: Configuration Philosophy1112964
+Node: Non-Unix Installation1115333
+Node: PC Installation1115791
+Node: PC Binary Installation1117111
+Node: PC Compiling1118963
+Ref: PC Compiling-Footnote-11121987
+Node: PC Testing1122096
+Node: PC Using1123276
+Node: Cygwin1127390
+Node: MSYS1128160
+Node: VMS Installation1128661
+Node: VMS Compilation1129452
+Ref: VMS Compilation-Footnote-11130681
+Node: VMS Dynamic Extensions1130739
+Node: VMS Installation Details1132424
+Node: VMS Running1134677
+Node: VMS GNV1138956
+Node: VMS Old Gawk1139691
+Node: Bugs1140162
+Node: Other Versions1144359
+Node: Installation summary1150943
+Node: Notes1152001
+Node: Compatibility Mode1152866
+Node: Additions1153648
+Node: Accessing The Source1154573
+Node: Adding Code1156008
+Node: New Ports1162227
+Node: Derived Files1166715
+Ref: Derived Files-Footnote-11172200
+Ref: Derived Files-Footnote-21172235
+Ref: Derived Files-Footnote-31172833
+Node: Future Extensions1172947
+Node: Implementation Limitations1173605
+Node: Extension Design1174788
+Node: Old Extension Problems1175942
+Ref: Old Extension Problems-Footnote-11177460
+Node: Extension New Mechanism Goals1177517
+Ref: Extension New Mechanism Goals-Footnote-11180881
+Node: Extension Other Design Decisions1181070
+Node: Extension Future Growth1183183
+Node: Old Extension Mechanism1184019
+Node: Notes summary1185782
+Node: Basic Concepts1186964
+Node: Basic High Level1187645
+Ref: figure-general-flow1187927
+Ref: figure-process-flow1188612
+Ref: Basic High Level-Footnote-11191913
+Node: Basic Data Typing1192098
+Node: Glossary1195426
+Node: Copying1227372
+Node: GNU Free Documentation License1264911
+Node: Index1290029
 
 End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index cfb40b6..3082689 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -18380,17 +18380,19 @@ When @option{--sandbox} is specified, the 
@code{system()} function is disabled
 On POSIX systems, a command's exit status is a 16-bit number. The exit
 value passed to the C @code{exit()} function is held in the high-order
 eight bits. The low-order bits indicate if the process was killed by a
-signal (bit 7) and if so, the signal number (bits 0--6).
+signal (bit 7) and if so, the guilty signal number (bits 0--6).
 
 Traditionally, @command{awk}'s @code{system()} function has simply
-returned the exit status value and ignored death-by-signal. POSIX
-states that @command{awk}'s @code{system()} should return the full
-16-bit value.
-
address@hidden steers a middle ground. With @option{--posix}, it returns
-the full 16-bit value. By default, it returns just the exit status. The
address@hidden option forces @command{gawk} to ignore
-death-by-signal, in which case @code{system()} returns zero.
+returned the exit status value divided by 256. In the normal case this
+gives the exit status but in the case of death-by-signal it yields
+a fractional floating-point value. POSIX states that @command{awk}'s
address@hidden()} should return the full 16-bit value.
+
address@hidden steers a middle ground.
+By default, it returns just the exit status. The
address@hidden option causes @command{gawk} to divide
+the return vaue by 356, 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
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 4b0af55..3831d6e 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -17572,17 +17572,19 @@ When @option{--sandbox} is specified, the 
@code{system()} function is disabled
 On POSIX systems, a command's exit status is a 16-bit number. The exit
 value passed to the C @code{exit()} function is held in the high-order
 eight bits. The low-order bits indicate if the process was killed by a
-signal (bit 7) and if so, the signal number (bits 0--6).
+signal (bit 7) and if so, the guilty signal number (bits 0--6).
 
 Traditionally, @command{awk}'s @code{system()} function has simply
-returned the exit status value and ignored death-by-signal. POSIX
-states that @command{awk}'s @code{system()} should return the full
-16-bit value.
-
address@hidden steers a middle ground. With @option{--posix}, it returns
-the full 16-bit value. By default, it returns just the exit status. The
address@hidden option forces @command{gawk} to ignore
-death-by-signal, in which case @code{system()} returns zero.
+returned the exit status value divided by 256. In the normal case this
+gives the exit status but in the case of death-by-signal it yields
+a fractional floating-point value. POSIX states that @command{awk}'s
address@hidden()} should return the full 16-bit value.
+
address@hidden steers a middle ground.
+By default, it returns just the exit status. The
address@hidden option causes @command{gawk} to divide
+the return vaue by 356, 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

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=0d76c6de321ecbf2cfda7d681cfce1ca80420be2

commit 0d76c6de321ecbf2cfda7d681cfce1ca80420be2
Author: Arnold D. Robbins <address@hidden>
Date:   Tue Mar 8 06:36:34 2016 +0200

    Improve return value of system.

diff --git a/ChangeLog b/ChangeLog
index fa434b2..deef701 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
 
        * profile.c (print_instruction): Further improvements in
        instruction dump, especially for when pretty-printing.
+       * builtin.c (do_system): Augment the logic for the return
+       value so that death-by-signal info is available too.
 
 2016-03-03         Arnold D. Robbins     <address@hidden>
 
diff --git a/NEWS b/NEWS
index 9386bae..31c8471 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,9 @@ Changes from 4.1.3 to 4.1.x
 7. The profiler / pretty-printer now chains else-if statements instead
    of causing cascading elses.
 
+8. The return value of system() has been enhanced to convey more information.
+   See the doc.
+
 Changes from 4.1.2 to 4.1.3
 ---------------------------
 
diff --git a/builtin.c b/builtin.c
index a62437a..375497f 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2081,8 +2081,26 @@ do_system(int nargs)
 
                os_restore_mode(fileno(stdin));
                ret = system(cmd);
-               if (ret != -1)
-                       ret = WEXITSTATUS(ret);
+               /*
+                * 3/2016. What to do with ret? It's never simple.
+                * POSIX says to use the full return value. BWK awk
+                * uses just the exit status. That seems more useful to
+                * me, but then death by signal info gets lost.
+                * So we compromise as follows:
+                */
+               if (ret != -1) {
+                       if (do_posix)
+                               ;       /* leave it alone, full 16 bits */
+                       else if (WIFEXITED(ret))
+                               ret = WEXITSTATUS(ret); /* normal exit */
+                       else if (do_traditional)
+                               ret = 0;        /* ignore signal death */
+                       else if (WIFSIGNALED(ret))
+                               /* use 256 since exit values are 8 bits */
+                               ret = WTERMSIG(ret) + 256;
+                       else
+                               ret = 0;        /* shouldn't get here */
+               }
                if ((BINMODE & BINMODE_INPUT) != 0)
                        os_setbinmode(fileno(stdin), O_BINARY);
 
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 87a1bc9..afe5841 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-07         Arnold D. Robbins     <address@hidden>
+
+       * gawktexi.in: Document system() return values.
+       * gawk.1: Add a pointer to the manual about same.
+
 2016-02-23         Arnold D. Robbins     <address@hidden>
 
        * sidebar.awk: Globally replace [[:space:]] with [ \t] so that
diff --git a/doc/gawk.1 b/doc/gawk.1
index da1f583..ca51a53 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -13,7 +13,7 @@
 .              if \w'\(rq' .ds rq "\(rq
 .      \}
 .\}
-.TH GAWK 1 "Dec 17 2015" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Mar 7 2016" "Free Software Foundation" "Utility Commands"
 .SH NAME
 gawk \- pattern scanning and processing language
 .SH SYNOPSIS
@@ -2259,6 +2259,7 @@ Execute the command
 .IR cmd-line ,
 and return the exit status.
 (This may not be available on non-\*(PX systems.)
+See the manual for the full details on the exit status.
 .TP
 \&\fBfflush(\fR[\fIfile\^\fR]\fB)\fR
 Flush any buffers associated with the open output file or pipe
diff --git a/doc/gawk.info b/doc/gawk.info
index b5b4547..3820a05 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12773,7 +12773,7 @@ parameters are enclosed in square brackets ([ ]):
 
 'system(COMMAND)'
      Execute the operating system command COMMAND and then return to the
-     'awk' program.  Return COMMAND's exit status.
+     'awk' program.  Return COMMAND's exit status (see further on).
 
      For example, if the following fragment of code is put in your 'awk'
      program:
@@ -12802,6 +12802,29 @@ parameters are enclosed in square brackets ([ ]):
           NOTE: When '--sandbox' is specified, the 'system()' function
           is disabled (*note Options::).
 
+     On POSIX systems, a command's exit status is a 16-bit number.  The
+     exit value passed to the C 'exit()' function is held in the
+     high-order eight bits.  The low-order bits indicate if the process
+     was killed by a signal (bit 7) and if so, the signal number (bits
+     0-6).
+
+     Traditionally, 'awk''s 'system()' function has simply returned the
+     exit status value and ignored death-by-signal.  POSIX states that
+     'awk''s 'system()' should return the full 16-bit value.
+
+     'gawk' steers a middle ground.  With '--posix', it returns the full
+     16-bit value.  By default, it returns just the exit status.  The
+     '--traditional' option forces 'gawk' to ignore death-by-signal, in
+     which case 'system()' returns zero.
+
+     If the process was killed by a signal, 'gawk''s 'system()' returns
+     256 + SIG, where 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 + SIG lets you clearly distinguish normal
+     exit from death-by-signal.
+
+     If some kind of error occurred, 'system()' returns -1.
+
              Controlling Output Buffering with 'system()'
 
    The 'fflush()' function provides explicit control over output
@@ -32195,11 +32218,11 @@ Index
 * Buening, Andreas:                      Acknowledgments.     (line  60)
 * Buening, Andreas <1>:                  Contributors.        (line  93)
 * Buening, Andreas <2>:                  Bugs.                (line  73)
-* buffering, input/output:               I/O Functions.       (line 139)
+* buffering, input/output:               I/O Functions.       (line 162)
 * buffering, input/output <1>:           Two-way I/O.         (line  53)
 * buffering, interactive vs. noninteractive: I/O Functions.   (line  76)
 * buffers, flushing:                     I/O Functions.       (line  32)
-* buffers, flushing <1>:                 I/O Functions.       (line 139)
+* buffers, flushing <1>:                 I/O Functions.       (line 162)
 * buffers, operators for:                GNU Regexp Operators.
                                                               (line  51)
 * bug reports, email address, address@hidden: Bugs.         (line  30)
@@ -33723,7 +33746,7 @@ Index
 * output redirection:                    Redirection.         (line   6)
 * output wrapper:                        Output Wrappers.     (line   6)
 * output, buffering:                     I/O Functions.       (line  32)
-* output, buffering <1>:                 I/O Functions.       (line 139)
+* output, buffering <1>:                 I/O Functions.       (line 162)
 * output, duplicating into files:        Tee Program.         (line   6)
 * output, files, closing:                Close Files And Pipes.
                                                               (line   6)
@@ -34219,7 +34242,7 @@ Index
                                                               (line  14)
 * sidebar, Changing NR and FNR:          Auto-set.            (line 311)
 * sidebar, Controlling Output Buffering with system(): I/O Functions.
-                                                              (line 137)
+                                                              (line 160)
 * sidebar, Escape Sequences for Metacharacters: Escape Sequences.
                                                               (line 135)
 * sidebar, FS and IGNORECASE:            Field Splitting Summary.
@@ -34874,317 +34897,317 @@ Ref: table-posix-sub537317
 Ref: table-gensub-escapes538858
 Ref: Gory Details-Footnote-1539681
 Node: I/O Functions539832
-Ref: I/O Functions-Footnote-1547052
-Node: Time Functions547200
-Ref: Time Functions-Footnote-1557705
-Ref: Time Functions-Footnote-2557773
-Ref: Time Functions-Footnote-3557931
-Ref: Time Functions-Footnote-4558042
-Ref: Time Functions-Footnote-5558154
-Ref: Time Functions-Footnote-6558381
-Node: Bitwise Functions558647
-Ref: table-bitwise-ops559241
-Ref: Bitwise Functions-Footnote-1563579
-Node: Type Functions563752
-Node: I18N Functions564908
-Node: User-defined566559
-Node: Definition Syntax567364
-Ref: Definition Syntax-Footnote-1573051
-Node: Function Example573122
-Ref: Function Example-Footnote-1576044
-Node: Function Caveats576066
-Node: Calling A Function576584
-Node: Variable Scope577542
-Node: Pass By Value/Reference580536
-Node: Return Statement584035
-Node: Dynamic Typing587014
-Node: Indirect Calls587944
-Ref: Indirect Calls-Footnote-1598195
-Node: Functions Summary598323
-Node: Library Functions601028
-Ref: Library Functions-Footnote-1604635
-Ref: Library Functions-Footnote-2604778
-Node: Library Names604949
-Ref: Library Names-Footnote-1608409
-Ref: Library Names-Footnote-2608632
-Node: General Functions608718
-Node: Strtonum Function609821
-Node: Assert Function612843
-Node: Round Function616169
-Node: Cliff Random Function617710
-Node: Ordinal Functions618726
-Ref: Ordinal Functions-Footnote-1621789
-Ref: Ordinal Functions-Footnote-2622041
-Node: Join Function622251
-Ref: Join Function-Footnote-1624021
-Node: Getlocaltime Function624221
-Node: Readfile Function627963
-Node: Shell Quoting629935
-Node: Data File Management631336
-Node: Filetrans Function631968
-Node: Rewind Function636064
-Node: File Checking637969
-Ref: File Checking-Footnote-1639303
-Node: Empty Files639504
-Node: Ignoring Assigns641483
-Node: Getopt Function643033
-Ref: Getopt Function-Footnote-1654502
-Node: Passwd Functions654702
-Ref: Passwd Functions-Footnote-1663541
-Node: Group Functions663629
-Ref: Group Functions-Footnote-1671526
-Node: Walking Arrays671733
-Node: Library Functions Summary674741
-Node: Library Exercises676147
-Node: Sample Programs676612
-Node: Running Examples677382
-Node: Clones678110
-Node: Cut Program679334
-Node: Egrep Program689263
-Ref: Egrep Program-Footnote-1696775
-Node: Id Program696885
-Node: Split Program700565
-Ref: Split Program-Footnote-1704024
-Node: Tee Program704153
-Node: Uniq Program706943
-Node: Wc Program714369
-Ref: Wc Program-Footnote-1718624
-Node: Miscellaneous Programs718718
-Node: Dupword Program719931
-Node: Alarm Program721961
-Node: Translate Program726816
-Ref: Translate Program-Footnote-1731381
-Node: Labels Program731651
-Ref: Labels Program-Footnote-1735002
-Node: Word Sorting735086
-Node: History Sorting739158
-Node: Extract Program740993
-Node: Simple Sed748522
-Node: Igawk Program751596
-Ref: Igawk Program-Footnote-1765927
-Ref: Igawk Program-Footnote-2766129
-Ref: Igawk Program-Footnote-3766251
-Node: Anagram Program766366
-Node: Signature Program769428
-Node: Programs Summary770675
-Node: Programs Exercises771889
-Ref: Programs Exercises-Footnote-1776018
-Node: Advanced Features776109
-Node: Nondecimal Data778099
-Node: Array Sorting779690
-Node: Controlling Array Traversal780390
-Ref: Controlling Array Traversal-Footnote-1788757
-Node: Array Sorting Functions788875
-Ref: Array Sorting Functions-Footnote-1793966
-Node: Two-way I/O794162
-Ref: Two-way I/O-Footnote-1799982
-Ref: Two-way I/O-Footnote-2800169
-Node: TCP/IP Networking800251
-Node: Profiling803369
-Node: Advanced Features Summary810908
-Node: Internationalization812844
-Node: I18N and L10N814324
-Node: Explaining gettext815011
-Ref: Explaining gettext-Footnote-1820034
-Ref: Explaining gettext-Footnote-2820219
-Node: Programmer i18n820384
-Ref: Programmer i18n-Footnote-1825239
-Node: Translator i18n825288
-Node: String Extraction826082
-Ref: String Extraction-Footnote-1827214
-Node: Printf Ordering827300
-Ref: Printf Ordering-Footnote-1830086
-Node: I18N Portability830150
-Ref: I18N Portability-Footnote-1832606
-Node: I18N Example832669
-Ref: I18N Example-Footnote-1835475
-Node: Gawk I18N835548
-Node: I18N Summary836193
-Node: Debugger837534
-Node: Debugging838556
-Node: Debugging Concepts838997
-Node: Debugging Terms840806
-Node: Awk Debugging843381
-Node: Sample Debugging Session844287
-Node: Debugger Invocation844821
-Node: Finding The Bug846207
-Node: List of Debugger Commands852685
-Node: Breakpoint Control854018
-Node: Debugger Execution Control857712
-Node: Viewing And Changing Data861074
-Node: Execution Stack864448
-Node: Debugger Info866085
-Node: Miscellaneous Debugger Commands870156
-Node: Readline Support875244
-Node: Limitations876140
-Node: Debugging Summary878249
-Node: Arbitrary Precision Arithmetic879422
-Node: Computer Arithmetic880838
-Ref: table-numeric-ranges884429
-Ref: Computer Arithmetic-Footnote-1885151
-Node: Math Definitions885208
-Ref: table-ieee-formats888522
-Ref: Math Definitions-Footnote-1889125
-Node: MPFR features889230
-Node: FP Math Caution890947
-Ref: FP Math Caution-Footnote-1892019
-Node: Inexactness of computations892388
-Node: Inexact representation893348
-Node: Comparing FP Values894708
-Node: Errors accumulate895790
-Node: Getting Accuracy897223
-Node: Try To Round899933
-Node: Setting precision900832
-Ref: table-predefined-precision-strings901529
-Node: Setting the rounding mode903359
-Ref: table-gawk-rounding-modes903733
-Ref: Setting the rounding mode-Footnote-1907141
-Node: Arbitrary Precision Integers907320
-Ref: Arbitrary Precision Integers-Footnote-1910304
-Node: POSIX Floating Point Problems910453
-Ref: POSIX Floating Point Problems-Footnote-1914335
-Node: Floating point summary914373
-Node: Dynamic Extensions916563
-Node: Extension Intro918116
-Node: Plugin License919382
-Node: Extension Mechanism Outline920179
-Ref: figure-load-extension920618
-Ref: figure-register-new-function922183
-Ref: figure-call-new-function923275
-Node: Extension API Description925337
-Node: Extension API Functions Introduction926785
-Node: General Data Types931597
-Ref: General Data Types-Footnote-1937552
-Node: Memory Allocation Functions937851
-Ref: Memory Allocation Functions-Footnote-1940696
-Node: Constructor Functions940795
-Node: Registration Functions942540
-Node: Extension Functions943225
-Node: Exit Callback Functions945524
-Node: Extension Version String946774
-Node: Input Parsers947437
-Node: Output Wrappers957322
-Node: Two-way processors961834
-Node: Printing Messages964098
-Ref: Printing Messages-Footnote-1965172
-Node: Updating ERRNO965325
-Node: Requesting Values966064
-Ref: table-value-types-returned966801
-Node: Accessing Parameters967684
-Node: Symbol Table Access968919
-Node: Symbol table by name969431
-Node: Symbol table by cookie971452
-Ref: Symbol table by cookie-Footnote-1975601
-Node: Cached values975665
-Ref: Cached values-Footnote-1979166
-Node: Array Manipulation979257
-Ref: Array Manipulation-Footnote-1980356
-Node: Array Data Types980393
-Ref: Array Data Types-Footnote-1983051
-Node: Array Functions983143
-Node: Flattening Arrays987001
-Node: Creating Arrays993909
-Node: Extension API Variables998680
-Node: Extension Versioning999316
-Node: Extension API Informational Variables1001207
-Node: Extension API Boilerplate1002271
-Node: Finding Extensions1006085
-Node: Extension Example1006644
-Node: Internal File Description1007442
-Node: Internal File Ops1011522
-Ref: Internal File Ops-Footnote-11023284
-Node: Using Internal File Ops1023424
-Ref: Using Internal File Ops-Footnote-11025807
-Node: Extension Samples1026081
-Node: Extension Sample File Functions1027610
-Node: Extension Sample Fnmatch1035259
-Node: Extension Sample Fork1036746
-Node: Extension Sample Inplace1037964
-Node: Extension Sample Ord1041174
-Node: Extension Sample Readdir1042010
-Ref: table-readdir-file-types1042899
-Node: Extension Sample Revout1043704
-Node: Extension Sample Rev2way1044293
-Node: Extension Sample Read write array1045033
-Node: Extension Sample Readfile1046975
-Node: Extension Sample Time1048070
-Node: Extension Sample API Tests1049418
-Node: gawkextlib1049910
-Node: Extension summary1052334
-Node: Extension Exercises1056026
-Node: Language History1057523
-Node: V7/SVR3.11059179
-Node: SVR41061331
-Node: POSIX1062765
-Node: BTL1064144
-Node: POSIX/GNU1064873
-Node: Feature History1070394
-Node: Common Extensions1083723
-Node: Ranges and Locales1085006
-Ref: Ranges and Locales-Footnote-11089622
-Ref: Ranges and Locales-Footnote-21089649
-Ref: Ranges and Locales-Footnote-31089884
-Node: Contributors1090105
-Node: History summary1095674
-Node: Installation1097054
-Node: Gawk Distribution1097998
-Node: Getting1098482
-Node: Extracting1099443
-Node: Distribution contents1101081
-Node: Unix Installation1106832
-Node: Quick Installation1107448
-Node: Additional Configuration Options1109875
-Node: Configuration Philosophy1111679
-Node: Non-Unix Installation1114048
-Node: PC Installation1114506
-Node: PC Binary Installation1115826
-Node: PC Compiling1117678
-Ref: PC Compiling-Footnote-11120702
-Node: PC Testing1120811
-Node: PC Using1121991
-Node: Cygwin1126105
-Node: MSYS1126875
-Node: VMS Installation1127376
-Node: VMS Compilation1128167
-Ref: VMS Compilation-Footnote-11129396
-Node: VMS Dynamic Extensions1129454
-Node: VMS Installation Details1131139
-Node: VMS Running1133392
-Node: VMS GNV1137671
-Node: VMS Old Gawk1138406
-Node: Bugs1138877
-Node: Other Versions1143074
-Node: Installation summary1149658
-Node: Notes1150716
-Node: Compatibility Mode1151581
-Node: Additions1152363
-Node: Accessing The Source1153288
-Node: Adding Code1154723
-Node: New Ports1160942
-Node: Derived Files1165430
-Ref: Derived Files-Footnote-11170915
-Ref: Derived Files-Footnote-21170950
-Ref: Derived Files-Footnote-31171548
-Node: Future Extensions1171662
-Node: Implementation Limitations1172320
-Node: Extension Design1173503
-Node: Old Extension Problems1174657
-Ref: Old Extension Problems-Footnote-11176175
-Node: Extension New Mechanism Goals1176232
-Ref: Extension New Mechanism Goals-Footnote-11179596
-Node: Extension Other Design Decisions1179785
-Node: Extension Future Growth1181898
-Node: Old Extension Mechanism1182734
-Node: Notes summary1184497
-Node: Basic Concepts1185679
-Node: Basic High Level1186360
-Ref: figure-general-flow1186642
-Ref: figure-process-flow1187327
-Ref: Basic High Level-Footnote-11190628
-Node: Basic Data Typing1190813
-Node: Glossary1194141
-Node: Copying1226087
-Node: GNU Free Documentation License1263626
-Node: Index1288744
+Ref: I/O Functions-Footnote-1548200
+Node: Time Functions548348
+Ref: Time Functions-Footnote-1558853
+Ref: Time Functions-Footnote-2558921
+Ref: Time Functions-Footnote-3559079
+Ref: Time Functions-Footnote-4559190
+Ref: Time Functions-Footnote-5559302
+Ref: Time Functions-Footnote-6559529
+Node: Bitwise Functions559795
+Ref: table-bitwise-ops560389
+Ref: Bitwise Functions-Footnote-1564727
+Node: Type Functions564900
+Node: I18N Functions566056
+Node: User-defined567707
+Node: Definition Syntax568512
+Ref: Definition Syntax-Footnote-1574199
+Node: Function Example574270
+Ref: Function Example-Footnote-1577192
+Node: Function Caveats577214
+Node: Calling A Function577732
+Node: Variable Scope578690
+Node: Pass By Value/Reference581684
+Node: Return Statement585183
+Node: Dynamic Typing588162
+Node: Indirect Calls589092
+Ref: Indirect Calls-Footnote-1599343
+Node: Functions Summary599471
+Node: Library Functions602176
+Ref: Library Functions-Footnote-1605783
+Ref: Library Functions-Footnote-2605926
+Node: Library Names606097
+Ref: Library Names-Footnote-1609557
+Ref: Library Names-Footnote-2609780
+Node: General Functions609866
+Node: Strtonum Function610969
+Node: Assert Function613991
+Node: Round Function617317
+Node: Cliff Random Function618858
+Node: Ordinal Functions619874
+Ref: Ordinal Functions-Footnote-1622937
+Ref: Ordinal Functions-Footnote-2623189
+Node: Join Function623399
+Ref: Join Function-Footnote-1625169
+Node: Getlocaltime Function625369
+Node: Readfile Function629111
+Node: Shell Quoting631083
+Node: Data File Management632484
+Node: Filetrans Function633116
+Node: Rewind Function637212
+Node: File Checking639117
+Ref: File Checking-Footnote-1640451
+Node: Empty Files640652
+Node: Ignoring Assigns642631
+Node: Getopt Function644181
+Ref: Getopt Function-Footnote-1655650
+Node: Passwd Functions655850
+Ref: Passwd Functions-Footnote-1664689
+Node: Group Functions664777
+Ref: Group Functions-Footnote-1672674
+Node: Walking Arrays672881
+Node: Library Functions Summary675889
+Node: Library Exercises677295
+Node: Sample Programs677760
+Node: Running Examples678530
+Node: Clones679258
+Node: Cut Program680482
+Node: Egrep Program690411
+Ref: Egrep Program-Footnote-1697923
+Node: Id Program698033
+Node: Split Program701713
+Ref: Split Program-Footnote-1705172
+Node: Tee Program705301
+Node: Uniq Program708091
+Node: Wc Program715517
+Ref: Wc Program-Footnote-1719772
+Node: Miscellaneous Programs719866
+Node: Dupword Program721079
+Node: Alarm Program723109
+Node: Translate Program727964
+Ref: Translate Program-Footnote-1732529
+Node: Labels Program732799
+Ref: Labels Program-Footnote-1736150
+Node: Word Sorting736234
+Node: History Sorting740306
+Node: Extract Program742141
+Node: Simple Sed749670
+Node: Igawk Program752744
+Ref: Igawk Program-Footnote-1767075
+Ref: Igawk Program-Footnote-2767277
+Ref: Igawk Program-Footnote-3767399
+Node: Anagram Program767514
+Node: Signature Program770576
+Node: Programs Summary771823
+Node: Programs Exercises773037
+Ref: Programs Exercises-Footnote-1777166
+Node: Advanced Features777257
+Node: Nondecimal Data779247
+Node: Array Sorting780838
+Node: Controlling Array Traversal781538
+Ref: Controlling Array Traversal-Footnote-1789905
+Node: Array Sorting Functions790023
+Ref: Array Sorting Functions-Footnote-1795114
+Node: Two-way I/O795310
+Ref: Two-way I/O-Footnote-1801130
+Ref: Two-way I/O-Footnote-2801317
+Node: TCP/IP Networking801399
+Node: Profiling804517
+Node: Advanced Features Summary812056
+Node: Internationalization813992
+Node: I18N and L10N815472
+Node: Explaining gettext816159
+Ref: Explaining gettext-Footnote-1821182
+Ref: Explaining gettext-Footnote-2821367
+Node: Programmer i18n821532
+Ref: Programmer i18n-Footnote-1826387
+Node: Translator i18n826436
+Node: String Extraction827230
+Ref: String Extraction-Footnote-1828362
+Node: Printf Ordering828448
+Ref: Printf Ordering-Footnote-1831234
+Node: I18N Portability831298
+Ref: I18N Portability-Footnote-1833754
+Node: I18N Example833817
+Ref: I18N Example-Footnote-1836623
+Node: Gawk I18N836696
+Node: I18N Summary837341
+Node: Debugger838682
+Node: Debugging839704
+Node: Debugging Concepts840145
+Node: Debugging Terms841954
+Node: Awk Debugging844529
+Node: Sample Debugging Session845435
+Node: Debugger Invocation845969
+Node: Finding The Bug847355
+Node: List of Debugger Commands853833
+Node: Breakpoint Control855166
+Node: Debugger Execution Control858860
+Node: Viewing And Changing Data862222
+Node: Execution Stack865596
+Node: Debugger Info867233
+Node: Miscellaneous Debugger Commands871304
+Node: Readline Support876392
+Node: Limitations877288
+Node: Debugging Summary879397
+Node: Arbitrary Precision Arithmetic880570
+Node: Computer Arithmetic881986
+Ref: table-numeric-ranges885577
+Ref: Computer Arithmetic-Footnote-1886299
+Node: Math Definitions886356
+Ref: table-ieee-formats889670
+Ref: Math Definitions-Footnote-1890273
+Node: MPFR features890378
+Node: FP Math Caution892095
+Ref: FP Math Caution-Footnote-1893167
+Node: Inexactness of computations893536
+Node: Inexact representation894496
+Node: Comparing FP Values895856
+Node: Errors accumulate896938
+Node: Getting Accuracy898371
+Node: Try To Round901081
+Node: Setting precision901980
+Ref: table-predefined-precision-strings902677
+Node: Setting the rounding mode904507
+Ref: table-gawk-rounding-modes904881
+Ref: Setting the rounding mode-Footnote-1908289
+Node: Arbitrary Precision Integers908468
+Ref: Arbitrary Precision Integers-Footnote-1911452
+Node: POSIX Floating Point Problems911601
+Ref: POSIX Floating Point Problems-Footnote-1915483
+Node: Floating point summary915521
+Node: Dynamic Extensions917711
+Node: Extension Intro919264
+Node: Plugin License920530
+Node: Extension Mechanism Outline921327
+Ref: figure-load-extension921766
+Ref: figure-register-new-function923331
+Ref: figure-call-new-function924423
+Node: Extension API Description926485
+Node: Extension API Functions Introduction927933
+Node: General Data Types932745
+Ref: General Data Types-Footnote-1938700
+Node: Memory Allocation Functions938999
+Ref: Memory Allocation Functions-Footnote-1941844
+Node: Constructor Functions941943
+Node: Registration Functions943688
+Node: Extension Functions944373
+Node: Exit Callback Functions946672
+Node: Extension Version String947922
+Node: Input Parsers948585
+Node: Output Wrappers958470
+Node: Two-way processors962982
+Node: Printing Messages965246
+Ref: Printing Messages-Footnote-1966320
+Node: Updating ERRNO966473
+Node: Requesting Values967212
+Ref: table-value-types-returned967949
+Node: Accessing Parameters968832
+Node: Symbol Table Access970067
+Node: Symbol table by name970579
+Node: Symbol table by cookie972600
+Ref: Symbol table by cookie-Footnote-1976749
+Node: Cached values976813
+Ref: Cached values-Footnote-1980314
+Node: Array Manipulation980405
+Ref: Array Manipulation-Footnote-1981504
+Node: Array Data Types981541
+Ref: Array Data Types-Footnote-1984199
+Node: Array Functions984291
+Node: Flattening Arrays988149
+Node: Creating Arrays995057
+Node: Extension API Variables999828
+Node: Extension Versioning1000464
+Node: Extension API Informational Variables1002355
+Node: Extension API Boilerplate1003419
+Node: Finding Extensions1007233
+Node: Extension Example1007792
+Node: Internal File Description1008590
+Node: Internal File Ops1012670
+Ref: Internal File Ops-Footnote-11024432
+Node: Using Internal File Ops1024572
+Ref: Using Internal File Ops-Footnote-11026955
+Node: Extension Samples1027229
+Node: Extension Sample File Functions1028758
+Node: Extension Sample Fnmatch1036407
+Node: Extension Sample Fork1037894
+Node: Extension Sample Inplace1039112
+Node: Extension Sample Ord1042322
+Node: Extension Sample Readdir1043158
+Ref: table-readdir-file-types1044047
+Node: Extension Sample Revout1044852
+Node: Extension Sample Rev2way1045441
+Node: Extension Sample Read write array1046181
+Node: Extension Sample Readfile1048123
+Node: Extension Sample Time1049218
+Node: Extension Sample API Tests1050566
+Node: gawkextlib1051058
+Node: Extension summary1053482
+Node: Extension Exercises1057174
+Node: Language History1058671
+Node: V7/SVR3.11060327
+Node: SVR41062479
+Node: POSIX1063913
+Node: BTL1065292
+Node: POSIX/GNU1066021
+Node: Feature History1071542
+Node: Common Extensions1084871
+Node: Ranges and Locales1086154
+Ref: Ranges and Locales-Footnote-11090770
+Ref: Ranges and Locales-Footnote-21090797
+Ref: Ranges and Locales-Footnote-31091032
+Node: Contributors1091253
+Node: History summary1096822
+Node: Installation1098202
+Node: Gawk Distribution1099146
+Node: Getting1099630
+Node: Extracting1100591
+Node: Distribution contents1102229
+Node: Unix Installation1107980
+Node: Quick Installation1108596
+Node: Additional Configuration Options1111023
+Node: Configuration Philosophy1112827
+Node: Non-Unix Installation1115196
+Node: PC Installation1115654
+Node: PC Binary Installation1116974
+Node: PC Compiling1118826
+Ref: PC Compiling-Footnote-11121850
+Node: PC Testing1121959
+Node: PC Using1123139
+Node: Cygwin1127253
+Node: MSYS1128023
+Node: VMS Installation1128524
+Node: VMS Compilation1129315
+Ref: VMS Compilation-Footnote-11130544
+Node: VMS Dynamic Extensions1130602
+Node: VMS Installation Details1132287
+Node: VMS Running1134540
+Node: VMS GNV1138819
+Node: VMS Old Gawk1139554
+Node: Bugs1140025
+Node: Other Versions1144222
+Node: Installation summary1150806
+Node: Notes1151864
+Node: Compatibility Mode1152729
+Node: Additions1153511
+Node: Accessing The Source1154436
+Node: Adding Code1155871
+Node: New Ports1162090
+Node: Derived Files1166578
+Ref: Derived Files-Footnote-11172063
+Ref: Derived Files-Footnote-21172098
+Ref: Derived Files-Footnote-31172696
+Node: Future Extensions1172810
+Node: Implementation Limitations1173468
+Node: Extension Design1174651
+Node: Old Extension Problems1175805
+Ref: Old Extension Problems-Footnote-11177323
+Node: Extension New Mechanism Goals1177380
+Ref: Extension New Mechanism Goals-Footnote-11180744
+Node: Extension Other Design Decisions1180933
+Node: Extension Future Growth1183046
+Node: Old Extension Mechanism1183882
+Node: Notes summary1185645
+Node: Basic Concepts1186827
+Node: Basic High Level1187508
+Ref: figure-general-flow1187790
+Ref: figure-process-flow1188475
+Ref: Basic High Level-Footnote-11191776
+Node: Basic Data Typing1191961
+Node: Glossary1195289
+Node: Copying1227235
+Node: GNU Free Documentation License1264774
+Node: Index1289892
 
 End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index dcd49e6..cfb40b6 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -18338,7 +18338,7 @@ it is all buffered and sent down the pipe to 
@command{cat} in one shot.
 @cindex interacting with other programs
 Execute the operating system
 command @var{command} and then return to the @command{awk} program.
-Return @var{command}'s exit status.
+Return @var{command}'s exit status (see further on).
 
 For example, if the following fragment of code is put in your @command{awk}
 program:
@@ -18377,6 +18377,29 @@ When @option{--sandbox} is specified, the 
@code{system()} function is disabled
 (@pxref{Options}).
 @end quotation
 
+On POSIX systems, a command's exit status is a 16-bit number. The exit
+value passed to the C @code{exit()} function is held in the high-order
+eight bits. The low-order bits indicate if the process was killed by a
+signal (bit 7) and if so, the signal number (bits 0--6).
+
+Traditionally, @command{awk}'s @code{system()} function has simply
+returned the exit status value and ignored death-by-signal. POSIX
+states that @command{awk}'s @code{system()} should return the full
+16-bit value.
+
address@hidden steers a middle ground. With @option{--posix}, it returns
+the full 16-bit value. By default, it returns just the exit status. The
address@hidden option forces @command{gawk} to ignore
+death-by-signal, in which case @code{system()} returns zero.
+
+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.
+
 @end table
 
 @cindex sidebar, Controlling Output Buffering with @code{system()}
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index ff5672a..4b0af55 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -17530,7 +17530,7 @@ it is all buffered and sent down the pipe to 
@command{cat} in one shot.
 @cindex interacting with other programs
 Execute the operating system
 command @var{command} and then return to the @command{awk} program.
-Return @var{command}'s exit status.
+Return @var{command}'s exit status (see further on).
 
 For example, if the following fragment of code is put in your @command{awk}
 program:
@@ -17569,6 +17569,29 @@ When @option{--sandbox} is specified, the 
@code{system()} function is disabled
 (@pxref{Options}).
 @end quotation
 
+On POSIX systems, a command's exit status is a 16-bit number. The exit
+value passed to the C @code{exit()} function is held in the high-order
+eight bits. The low-order bits indicate if the process was killed by a
+signal (bit 7) and if so, the signal number (bits 0--6).
+
+Traditionally, @command{awk}'s @code{system()} function has simply
+returned the exit status value and ignored death-by-signal. POSIX
+states that @command{awk}'s @code{system()} should return the full
+16-bit value.
+
address@hidden steers a middle ground. With @option{--posix}, it returns
+the full 16-bit value. By default, it returns just the exit status. The
address@hidden option forces @command{gawk} to ignore
+death-by-signal, in which case @code{system()} returns zero.
+
+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.
+
 @end table
 
 @sidebar Controlling Output Buffering with @code{system()}

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       |   11 +
 NEWS            |    3 +
 builtin.c       |   33 +++-
 doc/ChangeLog   |    9 +
 doc/gawk.1      |    3 +-
 doc/gawk.info   |  671 +++++++++++++++++++++++++++++--------------------------
 doc/gawk.texi   |   30 +++-
 doc/gawktexi.in |   30 +++-
 8 files changed, 464 insertions(+), 326 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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