Re: [PATCH v2] pidfd: avoid linux/wait.h and sys/wait.h name clashes

From: Christian Brauner
Date: Tue Oct 15 2019 - 15:39:03 EST


On Tue Oct 15, 2019 at 6:55 PM Christian Kellner wrote:
> From: Christian Kellner <christian@xxxxxxxxxx>
>
> Both linux/wait.h and sys/wait.h contain values for the first argument
> of 'waitid' (P_ALL, P_PID, ...). While the former uses defines the
> latter uses an enum. When linux/wait.h is included before sys/wait.h
> this will lead to an error, because P_ALL, P_PID, ... will already
> have been substituted to 0, 1, ... respectively and this the resulting
> code will be 'typedef enum {0, 1, ...'.
> Remove 'linux/wait.h' and rename P_PIDFD to avoid a future clash, in
> case P_PIDFD gets added to the idtype_t enum in sys/wait.h.
>
> Signed-off-by: Christian Kellner <christian@xxxxxxxxxx>

Reviewed-by: Christian Brauner <christian.brauner@xxxxxxxxxx>