From f6c6cdb9e0e05fdebcff1da5ecb3145f9cb29cc9 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 23 Jul 2008 21:29:39 -0700 Subject: [PATCH] --- yaml --- r: 105425 b: refs/heads/master c: 6b1ef0e60d42f2fdaec26baee8327eb156347b4f h: refs/heads/master i: 105423: 0e3e7b4b5adc39911319756b5d149876cee181fa v: v3 --- [refs] | 2 +- trunk/fs/timerfd.c | 4 ++-- trunk/include/linux/timerfd.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index acc29de4c717..52495330c30e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e7d476dfdf0bcfed478a207aecfdc84f81efecaf +refs/heads/master: 6b1ef0e60d42f2fdaec26baee8327eb156347b4f diff --git a/trunk/fs/timerfd.c b/trunk/fs/timerfd.c index c6ef5e33cb34..75d44efe346c 100644 --- a/trunk/fs/timerfd.c +++ b/trunk/fs/timerfd.c @@ -184,7 +184,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags) int ufd; struct timerfd_ctx *ctx; - if (flags & ~TFD_CLOEXEC) + if (flags & ~(TFD_CLOEXEC | TFD_NONBLOCK)) return -EINVAL; if (clockid != CLOCK_MONOTONIC && clockid != CLOCK_REALTIME) @@ -199,7 +199,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags) hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS); ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx, - flags & O_CLOEXEC); + flags & (O_CLOEXEC | O_NONBLOCK)); if (ufd < 0) kfree(ctx); diff --git a/trunk/include/linux/timerfd.h b/trunk/include/linux/timerfd.h index 96ed97dff00f..86cb0501d3e2 100644 --- a/trunk/include/linux/timerfd.h +++ b/trunk/include/linux/timerfd.h @@ -8,7 +8,7 @@ #ifndef _LINUX_TIMERFD_H #define _LINUX_TIMERFD_H -/* For O_CLOEXEC */ +/* For O_CLOEXEC and O_NONBLOCK */ #include /* Flags for timerfd_settime. */ @@ -16,6 +16,7 @@ /* Flags for timerfd_create. */ #define TFD_CLOEXEC O_CLOEXEC +#define TFD_NONBLOCK O_NONBLOCK #endif /* _LINUX_TIMERFD_H */