This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit d8717aab781e68fdc7ceafb8bf79c0478af9c700 Author: guoshichao <[email protected]> AuthorDate: Wed Jan 15 16:41:00 2025 +0800 sys/wait: add WTERMSIG implementation Update the WTERMSIG() macro to extract the signal number from the wait status, changing from constant 'false' to '(((s) >> 8) & 0x7f)' to match POSIX semantics for processes terminated by signals. Signed-off-by: guoshichao <[email protected]> --- include/sys/wait.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/sys/wait.h b/include/sys/wait.h index 658a236d553..1b67e182440 100644 --- a/include/sys/wait.h +++ b/include/sys/wait.h @@ -46,11 +46,11 @@ #define WEXITSTATUS(s) (((s) >> 8) & 0xff) /* Return exit status */ #define WIFEXITED(s) (((s) & 0xff) == 0) /* True: Child exited normally */ -#define WIFCONTINUED(s) (false) /* True: Child has been continued */ -#define WIFSIGNALED(s) (false) /* True: Child exited due to uncaught signal */ -#define WIFSTOPPED(s) (false) /* True: Child is currently stopped */ -#define WSTOPSIG(s) (false) /* Return signal number that caused process to stop */ -#define WTERMSIG(s) (false) /* Return signal number that caused process to terminate */ +#define WIFCONTINUED(s) (false) /* True: Child has been continued */ +#define WIFSIGNALED(s) (false) /* True: Child exited due to uncaught signal */ +#define WIFSTOPPED(s) (false) /* True: Child is currently stopped */ +#define WSTOPSIG(s) (false) /* Return signal number that caused process to stop */ +#define WTERMSIG(s) (((s) >> 8) & 0x7f) /* Return signal number that caused process to terminate */ /* The following symbolic constants are possible values for the options * argument to waitpid() (1) and/or waitid() (2),
