From f0c0f7a469c18dea61fab888d3f5f2f70b3c1c45 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 18 Oct 2016 14:34:50 +0300 Subject: Change test::script::command_exit::status type --- build2/test/script/script | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'build2/test/script/script') diff --git a/build2/test/script/script b/build2/test/script/script index b6a0f21..1127fb3 100644 --- a/build2/test/script/script +++ b/build2/test/script/script @@ -48,10 +48,26 @@ namespace build2 struct command_exit { - // @@ Need to understand what type we should use for status. - + // C/C++ don't apply constraints to program exit code values other than + // being of int type. + // + // POSIX specifies that only the least significant 8 bits shall be + // available from wait() and waitpid(); the full value shall be + // available from waitid() (read more at + // http://pubs.opengroup.org/onlinepubs/9699919799/functions/_Exit.html). + // While Linux man page for waitid() doesn't mention any deviations + // from the standard the FreeBSD implementation (as of version 11.0) + // only returns 8 bits like the other wait*() calls. + // + // Windows supports 32-bit exit codes. + // + // Note that in shells some exit values can have a special meaning so + // using them can be a source of confusion, For bash values in the + // [126, 255] range are such a special ones (read more at + // http://tldp.org/LDP/abs/html/exitcodes.html). + // exit_comparison comparison = exit_comparison::eq; - uint16_t status = 0; + uint8_t status = 0; }; struct test: command -- cgit v1.1