mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
flag parameters: check magic constants
This patch adds test that ensure the boundary conditions for the various constants introduced in the previous patches is met. No code is generated. [akpm@linux-foundation.org: fix alpha] Signed-off-by: Ulrich Drepper <drepper@redhat.com> Acked-by: Davide Libenzi <davidel@xmailserver.org> Cc: Michael Kerrisk <mtk.manpages@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
510df2dd48
commit
e38b36f325
@@ -184,6 +184,10 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
|
||||
int ufd;
|
||||
struct timerfd_ctx *ctx;
|
||||
|
||||
/* Check the TFD_* constants for consistency. */
|
||||
BUILD_BUG_ON(TFD_CLOEXEC != O_CLOEXEC);
|
||||
BUILD_BUG_ON(TFD_NONBLOCK != O_NONBLOCK);
|
||||
|
||||
if (flags & ~(TFD_CLOEXEC | TFD_NONBLOCK))
|
||||
return -EINVAL;
|
||||
if (clockid != CLOCK_MONOTONIC &&
|
||||
|
Reference in New Issue
Block a user