Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp151057rda; Sat, 21 Oct 2023 02:14:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmtNxmDfSskXAxsoHia/sk3Y9hBAd6r1II5lxRmoQZNS8VeyRLjvJbiqEPWOC3o9QLDJcY X-Received: by 2002:a05:6871:b24:b0:1ea:746d:1703 with SMTP id fq36-20020a0568710b2400b001ea746d1703mr4713653oab.7.1697879665868; Sat, 21 Oct 2023 02:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697879665; cv=none; d=google.com; s=arc-20160816; b=DMx7aJfoHdTYMWyt4GYEkrFyctw8xh4M0JwE3ZxKZ7FPhAvopFloAE12hM7mIPSCe7 TJpxUqk+1VQu18pgR4ilWOozTDy/Ar2bJUu1IJVUFzwEwGaW2C/czEcYZ7z7BmOzAOkQ HVqg4EjBTwzzcOF98EBsyB/FPIaguUlfpkDgJBSI27LpojjvEkud6i7nA5DZygi4C5M+ p7eDm66U8nw7D/5O7mG+I0l07D6OF1y0EjGlW6pIQXwYPpMkstIKT3dWdkf8kIf2uAfV jiOTbDentCWuq48GH4S5Fu078WOb4KiqKCyL5DToSd1bfAIZ14eGbDPp/UDq4B6umiOA mmPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kB050YqdzvWIAejlY3UbTBpMvEwWOYPgW/cJ9XSWdOE=; fh=uP2BzvEqshtQnovuXjTB11dRvEOLDwy+7oncQhuHUKA=; b=IOkTAKxFmEIEiK8h0736ihRH0KyuEjS0LfbaasAkAuWnFT3M3Pe9LAq2Zkw7kCEsLl znUxvPUcc7MFc7rdNluV1ToVVFncA0dUaRfwXX0ZWJ1pGo74egYUx2oIq7i6IiHDDkuw lkaCVBhcZoh8OllRpwwfKorBZ4S4CtRoVZgg0jDknRjFIQl6xd5FUlVnL31UzvFmBfzZ ntXJDGGaIYCXmNMU805PJbR8OF6Rj/wLTrY6jZWzE1TYuV9+8oAgvCRAAEoGuyT8kXZ8 6/ASA6qyDGC4f9Ys7ogcuMon8cH0BdTCDCqiRxbVG52cLP8joEVpaCyLK71LfkI12vHE kkkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id w25-20020a637b19000000b005b02d7bb426si3214576pgc.282.2023.10.21.02.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 02:14:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A306F8198C72; Sat, 21 Oct 2023 02:14:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbjJUJOK (ORCPT + 99 others); Sat, 21 Oct 2023 05:14:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjJUJOJ (ORCPT ); Sat, 21 Oct 2023 05:14:09 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B2243B0 for ; Sat, 21 Oct 2023 02:14:06 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 39L9DcfV028421; Sat, 21 Oct 2023 11:13:38 +0200 Date: Sat, 21 Oct 2023 11:13:38 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Mark Brown , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , linux-kernel@vger.kernel.org Subject: Re: [PATCH] tools/nolibc: Add Linux specific waitpid() flags Message-ID: References: <20231020-nolibc-waitpid-flags-v1-1-8137072dae14@kernel.org> <633402b0-7167-465f-99c6-d959b5f48073@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <633402b0-7167-465f-99c6-d959b5f48073@t-8ch.de> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 21 Oct 2023 02:14:23 -0700 (PDT) Hi Thomas, On Sat, Oct 21, 2023 at 11:00:20AM +0200, Thomas Wei?schuh wrote: > Hi, > > Oct 20, 2023 23:57:01 Mark Brown : > > > Linux defines a few custom flags for waitpid(), make them available to > > nolibc based programs. > > > > Signed-off-by: Mark Brown > > --- > > tools/include/nolibc/types.h | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h > > index 8cfc4c860fa4..801ea0bb186e 100644 > > --- a/tools/include/nolibc/types.h > > +++ b/tools/include/nolibc/types.h > > @@ -109,7 +109,10 @@ > > #define WIFSIGNALED(status) ((status) - 1 < 0xff) > > > > /* waitpid() flags */ > > -#define WNOHANG????? 1 > > +#define WNOHANG????? 0x00000001 > > +#define __WNOTHREAD? 0x20000000 > > +#define __WALL?????? 0x40000000 > > +#define __WCLONE???? 0x80000000 > > Wouldn't it be easier to include linux/wait.h instead? That's indeed the trend we should follow whenever possible. We've got caught a few times in the past with build errors depending on the includes ordering due to such redefinitions. I don't know if that's the case for these ones (nor if including linux/wait.h would cause other breakage) but it's worth considering at least. The difficulty here is that originally nolibc did not *explicitly* depend on UAPI headers, and was supposed to be self-sufficient (that was the main point). Adapting to multiple archs caused the addition of ifdefs all around, then trying to standardize the include file names instead of just "nolibc.h" caused conflicts with programs already including linux/anything.h. Anyway now we depend on linux/lots-of-stuff so I think it's worth continuing in that direction so that we don't replicate the UAPI maintenance effort. Cheers, Willy