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.

[[email protected]: fix alpha]
Signed-off-by: Ulrich Drepper <[email protected]>
Acked-by: Davide Libenzi <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Ulrich Drepper 2008-07-23 21:29:42 -07:00 • committed by Linus Torvalds
commit e38b36f325
6 changed files with 25 additions and 0 deletions

View file

@ -203,6 +203,10 @@ asmlinkage long sys_eventfd2(unsigned int count, int flags)
int fd;
struct eventfd_ctx *ctx;
/* Check the EFD_* constants for consistency. */
BUILD_BUG_ON(EFD_CLOEXEC != O_CLOEXEC);
BUILD_BUG_ON(EFD_NONBLOCK != O_NONBLOCK);
if (flags & ~(EFD_CLOEXEC | EFD_NONBLOCK))
return -EINVAL;