Message ID | 20230223-nolibc-stackprotector-v2-2-4c938e098d67@weissschuh.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1293003wrt; Mon, 20 Mar 2023 08:56:38 -0700 (PDT) X-Google-Smtp-Source: AK7set+ZEbAcuPZgOrJ6SHGPbNc8qIVI0O1LxSuZ2K6NFxz6PSop4UClKtC+pyNStTFtWKViGYJb X-Received: by 2002:a05:6a20:1b21:b0:bc:b9d2:f0f8 with SMTP id ch33-20020a056a201b2100b000bcb9d2f0f8mr14956388pzb.24.1679327798512; Mon, 20 Mar 2023 08:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679327798; cv=none; d=google.com; s=arc-20160816; b=VZeM4spw1NSuT0NigIA5dAWZJ9UzhOMc4rXByLCS9ifcdbcM9sgJ8wqyfgR2MauIrQ h2uBzwLlD9eqX5xHl8C7A7q2siHHhvBaEkAaKvVV7bitSi5Ji9Pvh2YchbdGQ7F7OIDD CYqT/ECvanI4CixOMloTk6t0SYTxRfk4mRg2ZJ8RT7DRKQznnWXszanUlQ1oPM1VE3pi OutU/rPyEXo6eccDBmM0wlSzinfnnEpMZmzkt1VV2CqqnRaJxXlqMn81DZkkWdPSUrgP WORgi2T4JxELYMI+GXSnphynY1LGGSv8DHLkcXHLp85zTvtloV0kmwubsEq3sQImIiwu 4AhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:dkim-signature :from; bh=QtaYHJK06RUU1vl5oGY7FqPpAkb/wrFegpwEGEwFLhE=; b=TVjH7N78/XZIWadiMF5j5o8q6cBShBiW3QoIdWZaR0nISWLpcK5o1Rxnal6jBNmPlS DVLuPyUF2TZ3ElHnAlZNqnZdcFF4DDfuIW3floV2c/V86tbCW7KKqzjdNYrxxSXDTyd/ foyOijuKW5kwuZad+8an5qe7AKA6lc2JwjOToetDZSDgMxcT8FdxIdf799/8Eah6OIkL xfJ4nkDogseOaLW/m+s89KMqYv6dPpajm6MmMfQdH+E/fZYGPigOhhps1svoq9zSvFLT N3ThHRXFcgPV+v+bh4r/wvdY9Y3wvaszy/QmATA7wD9+FtFJCpV0mTcYsheD64/7ao40 My7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=IHMVRtWu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a63cf0f000000b004fb8f5e1a8dsi10261562pgg.111.2023.03.20.08.56.24; Mon, 20 Mar 2023 08:56:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=IHMVRtWu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232174AbjCTPvD (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Mon, 20 Mar 2023 11:51:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233318AbjCTPtq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Mar 2023 11:49:46 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75DFF17CC2; Mon, 20 Mar 2023 08:41:22 -0700 (PDT) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1679326880; bh=kDTA/21oI749eXgqkTICe/hP0ZrhsZxLs1p4SViVcik=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IHMVRtWuNIrMjPv+fPIaRco5Zvkm46iZEMI6ff032Rx7DVn3JcRHkI40aVEhiUpsy agcXLWUHKr36lnpyCVx1+LYWzWdWQ9LFM7N10AAAvnJueOB77lj6m8qrMbBO23XECS 8AJ1byM4MDVDKet325db7VjMOdhmzX/dPHJPuXyg= Date: Mon, 20 Mar 2023 15:41:02 +0000 Subject: [PATCH v2 2/8] tools/nolibc: add helpers for wait() signal exits MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230223-nolibc-stackprotector-v2-2-4c938e098d67@weissschuh.net> References: <20230223-nolibc-stackprotector-v2-0-4c938e098d67@weissschuh.net> In-Reply-To: <20230223-nolibc-stackprotector-v2-0-4c938e098d67@weissschuh.net> To: Willy Tarreau <w@1wt.eu>, Shuah Khan <shuah@kernel.org> Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1679326878; l=748; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=kDTA/21oI749eXgqkTICe/hP0ZrhsZxLs1p4SViVcik=; b=7SZUc64snn7Oyq0C6XQf38MIzZwpIuEH3UWa7OMnKFv93KjtsDh0KApaaF2mWdMJT1SQxXq3t aao0zmzVnoqBwWiEy8lAX2FS61kHwgkQPySInAqZn+/Z9f20VQ7UHUB X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760902825896631697?= X-GMAIL-MSGID: =?utf-8?q?1760902825896631697?= |
Series |
tools/nolibc: add support for stack protector
|
|
Commit Message
Thomas Weißschuh
March 20, 2023, 3:41 p.m. UTC
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