[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191015142847.fa5ypv2qrocbuifd@wittgenstein>
Date: Tue, 15 Oct 2019 16:28:48 +0200
From: Christian Brauner <christian.brauner@...ntu.com>
To: Christian Kellner <ckellner@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Christian Kellner <christian@...lner.me>,
Shuah Khan <shuah@...nel.org>, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH] pidfd: fix selftest compilation by removing linux/wait.h
On Fri, Oct 11, 2019 at 06:38:11PM +0200, Christian Kellner wrote:
> From: Christian Kellner <christian@...lner.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@...lner.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
Powered by blists - more mailing lists