mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
eventfd: add a BUILD_BUG_ON() to ensure consistency between EFD_SEMAPHORE and the uapi
introduce a BUILD_BUG_ON to check that the EFD_SEMAPHORE is equal to its definition in the uapi file, just like EFD_CLOEXEC and EFD_NONBLOCK. Signed-off-by: Wen Yang <wenyang.linux@foxmail.com> Link: https://lore.kernel.org/r/tencent_0BAA2DEAF9208D49987457E6583F9BE79507@qq.com Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Christian Brauner <brauner@kernel.org> Cc: Jens Axboe <axboe@kernel.dk> Cc: Jan Kara <jack@suse.cz> Cc: <linux-fsdevel@vger.kernel.org> Cc: <linux-kernel@vger.kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
6c8ac6e24e
commit
6b6ec4ca4e
@ -383,6 +383,7 @@ static int do_eventfd(unsigned int count, int flags)
|
||||
/* Check the EFD_* constants for consistency. */
|
||||
BUILD_BUG_ON(EFD_CLOEXEC != O_CLOEXEC);
|
||||
BUILD_BUG_ON(EFD_NONBLOCK != O_NONBLOCK);
|
||||
BUILD_BUG_ON(EFD_SEMAPHORE != (1 << 0));
|
||||
|
||||
if (flags & ~EFD_FLAGS_SET)
|
||||
return -EINVAL;
|
||||
|
Loading…
Reference in New Issue
Block a user