From: Christian Brauner <christian.brauner@ubuntu.com>
To: Christian Kellner <ckellner@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Christian Kellner <christian@kellner.me>,
Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH] pidfd: fix selftest compilation by removing linux/wait.h
Date: Tue, 15 Oct 2019 16:28:48 +0200 [thread overview]
Message-ID: <20191015142847.fa5ypv2qrocbuifd@wittgenstein> (raw)
In-Reply-To: <20191011163811.8607-1-ckellner@redhat.com>
On Fri, Oct 11, 2019 at 06:38:11PM +0200, Christian Kellner wrote:
> From: Christian Kellner <christian@kellner.me>
>
> The pidfd_{open,poll}_test.c files both include `linux/wait.h` and
> later `sys/wait.h`. The former has `#define P_ALL 0`, but in the
> latter P_ALL is part of idtype_t enum, where it gets substituted
> due to the aforementioned define to be `0`, which then results in
> `typedef enum {0, ...`, which then results into a compiler error:
> "error: expected identifier before numeric constant".
> Since we need `sys/wait.h` for waitpid, drop `linux/wait.h`.
>
> Signed-off-by: Christian Kellner <christian@kellner.me>
Sorry, I missed this patch.
This is problematic and your patch would only temporarily fix it.
If glibc adds a P_PIDFD to the enum we'll run into the same issue.
So please:
- remove the linux/wait.h header (as you've already done here)
- add a custom define for P_PIDFD under a different name, e.g.:
#ifndef __P_PIDFD
#define __P_PIDFD 3
#endif
and add a comment above it explaining the reason for this mess.
Thanks and (_ugh_)
Christian
next prev parent reply other threads:[~2019-10-15 14:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 16:38 Christian Kellner
2019-10-15 14:28 ` Christian Brauner [this message]
2019-10-15 16:55 ` [PATCH v2] pidfd: avoid linux/wait.h and sys/wait.h name clashes Christian Kellner
2019-10-15 19:38 ` Christian Brauner
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=20191015142847.fa5ypv2qrocbuifd@wittgenstein \
--to=christian.brauner@ubuntu.com \
--cc=christian@kellner.me \
--cc=ckellner@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
/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®