glib/docs/reference/glib
Simon McVittie e0b6b8037d Distinguish more clearly between wait status and exit status
On Unix platforms, wait() and friends yield an integer that encodes
how the process exited. Confusingly, this is usually not the same as
the integer passed to exit() or returned from main(): conceptually it's
an integer encoding of this tagged union:

    enum { EXITED, SIGNALLED, ... } tag;
    union {
        int exit_status;         /* if EXITED */
        struct {
            int terminating_signal;
            bool core_dumped;
        } terminating_signal;    /* if SIGNALLED */
        ...
    } detail;

Meanwhile, on Windows, wait statuses and exit statuses are
interchangeable.

I find that it's clearer what is going on if we are consistent about
referring to the result of wait() as a "wait status", and the value
passed to exit() as an "exit status".

GSubprocess already gets this right: g_subprocess_get_status() returns
the wait status, while g_subprocess_get_exit_status() genuinely returns
the exit status. However, the GSpawn family of APIs has tended to
conflate the two.

Confusingly, g_spawn_check_exit_status() has always checked a wait
status, and it would not be correct to pass an exit status to it; so
let's deprecate it in favour of g_spawn_check_wait_status(), which
does the same thing that g_spawn_check_exit_status() always did.
Code that needs backwards-compatibility with older GLib can use:

    #if !GLIB_CHECK_VERSION(2, 69, 0)
    #define g_spawn_check_wait_status(x) (g_spawn_check_exit_status (x))
    #endif

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-15 14:33:14 +01:00
..
xml docs: Change Bugzilla references to GitLab 2018-06-15 13:04:39 +01:00
building.xml docs: Clarify the meaning of --buildtype=plain a little 2020-11-18 13:29:11 +00:00
changes.xml tree: Fix various typos and outdated terminology 2020-06-12 15:01:08 +01:00
compiling.xml compiling.xml: Don't recommend backticks 2021-06-09 10:13:27 +00:00
cross.xml Make ld executable configurable 2019-11-04 15:08:33 +00:00
file-name-encodings.png Huh? This was a 6-byte file. Replaced it with the correct one. 2006-01-12 19:47:02 +00:00
file-name-encodings.sxd Replaced with the correct file. 2006-01-12 19:49:32 +00:00
glib-docs.xml gversionmacros: Add version macros for GLib 2.70 2021-03-18 13:58:41 +00:00
glib-gettextize.xml docs: Improve man page consistency 2012-08-03 23:36:45 -04:00
glib-overrides.txt docs: fix bogus override for GIConv 2017-10-27 12:06:41 +01:00
glib-sections.txt Distinguish more clearly between wait status and exit status 2021-06-15 14:33:14 +01:00
gtester-report.xml glib: Deprecate gtester and gtester-report 2019-05-14 12:14:54 +01:00
gtester.xml glib: Deprecate gtester and gtester-report 2019-05-14 12:14:54 +01:00
gvariant-text.xml tree: Fix various typos and outdated terminology 2020-06-12 15:01:08 +01:00
gvariant-varargs.xml docs: Standardize spelling of serializ* 2021-05-07 08:51:22 -03:00
mainloop-states.eps add images 2000-12-05 20:43:58 +00:00
mainloop-states.fig add images 2000-12-05 20:43:58 +00:00
mainloop-states.gif add images 2000-12-05 20:43:58 +00:00
mainloop-states.png add images 2000-12-05 20:43:58 +00:00
meson.build gtrace: Add sysprof tracing support infrastructure 2020-07-07 11:17:10 +01:00
programming.xml docs: fix grammar in Writing GLib Applications/Threads 2016-01-31 12:54:28 -05:00
regex-syntax.xml tree: Fix various typos and outdated terminology 2020-06-12 15:01:08 +01:00
resources.xml docs: Remove mentions of mailing lists 2019-07-23 11:27:30 +01:00
running.xml docs: Wrap a code example more tightly to reduce minimum page width 2021-06-03 12:52:51 +01:00
Sorted_binary_tree_breadth-first_traversal.svg More GTree and GNode formatting and documentation fixes 2014-01-19 23:49:12 -05:00
Sorted_binary_tree_inorder.svg More GTree and GNode formatting and documentation fixes 2014-01-19 23:49:12 -05:00
Sorted_binary_tree_postorder.svg More GTree and GNode formatting and documentation fixes 2014-01-19 23:49:12 -05:00
Sorted_binary_tree_preorder.svg More GTree and GNode formatting and documentation fixes 2014-01-19 23:49:12 -05:00
version.xml.in Add version info to API docs. 2002-11-23 01:37:17 +00:00