Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp663792rwl; Sat, 25 Mar 2023 08:46:20 -0700 (PDT) X-Google-Smtp-Source: AKy350bpXa1vtvM3PUfHKhUisPK9mfziFgmrMrisSuqtHTVJ0DsmAPazl4wMsBxjyFgG7X90xyOY X-Received: by 2002:a17:90a:db97:b0:236:6a28:f784 with SMTP id h23-20020a17090adb9700b002366a28f784mr6741986pjv.3.1679759179928; Sat, 25 Mar 2023 08:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679759179; cv=none; d=google.com; s=arc-20160816; b=aGVDTN7FpEVdI/JZiksJ4F8nJeMG/9Lui0Ex54mAk9UFG3jgcSEQbehCqzrJu2bYFc DX63pbbJBJhf8xTd1ZASe+SL6V2p73yLE/d6ImyLLreVE2KBg8i1jc95v9QjnA5WRGiA MJVwaCvmwt9M80JHGtCkNfYKxrm6npcPxHz4/jJFo/spcyZAqFUYwQn800nCF8OWjCqP yuc53wHIJJtf7ylhQrk3Gcd2uxce9wHP7GKhKOC5pfgmuYUXNN/Yd7wvzzAMJh8CEvxT qwu1RdYwPOgiQEKOUkLnvSwEi1QUCqFdhCOSvYwPnYnHbtfuSN5KTf0mIu4XvZ8BsMV4 5LHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vFtDkU9GwpFdVYmCGq/KesiSiTVY34zuIhqy9dpGmF8=; b=mreqceuQZUMO5lqg5GFCPxQS5T+Zi7h3dyYnkzxXj6ekZJ0OQwwLpuToivLMZs/MqH K7Lj0s3+mXIYwlU73X2KbHfqpYXCk951ui+go86id9Cp8F1j8JF12iPzTd2tnLixJCAA SXf5yictlMSv08ibm8Vk/tUmPB8X6Q5BPuzFgfYtvwulZZRbbcOlOOo4S/3NvnYRaIJj J39mLWVuZQM3GUAYrm9VXyRp01GNCTCwY6NiywxjJiSZHyQGtcmWXe7RgY9eL5/nJEdL ajEeAnqCeiVvSWoyl8hrcr/bNBhtaeCSDAK4rzsQG2rJaBXnKZ10t+cI8ZODaZXRF59D 6mqw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g21-20020a170902d1d500b0019aa6450ff3si22016323plb.585.2023.03.25.08.46.08; Sat, 25 Mar 2023 08:46:19 -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; 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 S230424AbjCYPpr (ORCPT + 99 others); Sat, 25 Mar 2023 11:45:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbjCYPpl (ORCPT ); Sat, 25 Mar 2023 11:45:41 -0400 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B2743EC6E for ; Sat, 25 Mar 2023 08:45:39 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 32PFjQQQ008047; Sat, 25 Mar 2023 16:45:26 +0100 From: Willy Tarreau To: "Paul E. McKenney" Cc: linux@weissschuh.net, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH 2/8] tools/nolibc: add helpers for wait() signal exits Date: Sat, 25 Mar 2023 16:45:10 +0100 Message-Id: <20230325154516.7995-3-w@1wt.eu> X-Mailer: git-send-email 2.17.5 In-Reply-To: <20230325154516.7995-1-w@1wt.eu> References: <20230325154516.7995-1-w@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Weißschuh These are useful for users and will also be used in an upcoming testcase. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau --- 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.17.5