All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Willy Tarreau <w@1wt.eu>, Shuah Khan <shuah@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH RFC 2/5] tools/nolibc: add helpers for wait() signal exits
Date: Tue, 07 Mar 2023 22:22:31 +0000	[thread overview]
Message-ID: <20230223-nolibc-stackprotector-v1-2-3e74d81b3f21@weissschuh.net> (raw)
In-Reply-To: <20230223-nolibc-stackprotector-v1-0-3e74d81b3f21@weissschuh.net>

These are useful for users and will also be used in an upcoming
testcase.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 tools/include/nolibc/types.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index 10823e5ac44b..aedd7d9e3f64 100644
--- a/tools/include/nolibc/types.h
+++ b/tools/include/nolibc/types.h
@@ -97,6 +97,8 @@
 /* Macros used on waitpid()'s return status */
 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
 #define WIFEXITED(status)   (((status) & 0x7f) == 0)
+#define WTERMSIG(status)    ((status) & 0x7f)
+#define WIFSIGNALED(status) ((status) - 1 < 0xff)
 
 /* waitpid() flags */
 #define WNOHANG      1

-- 
2.39.2


  parent reply	other threads:[~2023-03-07 22:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 22:22 [PATCH RFC 0/5] tools/nolibc: add support for stack protector Thomas Weißschuh
2023-03-07 22:22 ` [PATCH RFC 1/5] tools/nolibc: add definitions for standard fds Thomas Weißschuh
2023-03-07 22:22 ` Thomas Weißschuh [this message]
2023-03-07 22:22 ` [PATCH RFC 3/5] tools/nolibc: tests: constify test_names Thomas Weißschuh
2023-03-07 22:22 ` [PATCH RFC 4/5] tools/nolibc: add support for stack protector Thomas Weißschuh
2023-03-12 12:56   ` Willy Tarreau
2023-03-12 23:06     ` Thomas Weißschuh
2023-03-13  3:24       ` Willy Tarreau
2023-03-07 22:22 ` [PATCH RFC 5/5] tools/nolibc: tests: add test for -fstack-protector Thomas Weißschuh
2023-03-12 13:07   ` Willy Tarreau
2023-03-12 23:12     ` Thomas Weißschuh
2023-03-13  3:08       ` Willy Tarreau
2023-03-18 16:49         ` Thomas Weißschuh
2023-03-19 13:58           ` Willy Tarreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230223-nolibc-stackprotector-v1-2-3e74d81b3f21@weissschuh.net \
    --to=linux@weissschuh.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.