mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <thomas@t-8ch.de>
Cc: "Mark Brown" <broonie@kernel.org>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/nolibc: Add Linux specific waitpid() flags
Date: Sat, 21 Oct 2023 11:13:38 +0200	[thread overview]
Message-ID: <ZTOWQnFwrQufHUyw@1wt.eu> (raw)
In-Reply-To: <633402b0-7167-465f-99c6-d959b5f48073@t-8ch.de>

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 <broonie@kernel.org>:
> 
> > Linux defines a few custom flags for waitpid(), make them available to
> > nolibc based programs.
> >
> > Signed-off-by: Mark Brown <broonie@kernel.org>
> > ---
> > 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

  reply	other threads:[~2023-10-21  9:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 21:56 Mark Brown
2023-10-21  9:00 ` Thomas Weißschuh 
2023-10-21  9:13   ` Willy Tarreau [this message]
2023-10-23 13:20     ` Mark Brown

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=ZTOWQnFwrQufHUyw@1wt.eu \
    --to=w@1wt.eu \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=thomas@t-8ch.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®