From a0fbf612a92bef4c07d8e08f0a8ec22e43823675 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 23 Jul 2008 21:29:38 -0700 Subject: [PATCH] --- yaml --- r: 105424 b: refs/heads/master c: e7d476dfdf0bcfed478a207aecfdc84f81efecaf h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/eventfd.c | 4 ++-- trunk/include/linux/eventfd.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 4f9793a2fc21..acc29de4c717 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5fb5e04926a54bc1c22bba7ca166840f4476196f +refs/heads/master: e7d476dfdf0bcfed478a207aecfdc84f81efecaf diff --git a/trunk/fs/eventfd.c b/trunk/fs/eventfd.c index bd420e6478ad..3ed4466177a7 100644 --- a/trunk/fs/eventfd.c +++ b/trunk/fs/eventfd.c @@ -203,7 +203,7 @@ asmlinkage long sys_eventfd2(unsigned int count, int flags) int fd; struct eventfd_ctx *ctx; - if (flags & ~EFD_CLOEXEC) + if (flags & ~(EFD_CLOEXEC | EFD_NONBLOCK)) return -EINVAL; ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); @@ -218,7 +218,7 @@ asmlinkage long sys_eventfd2(unsigned int count, int flags) * anon_inode_getfd() will install the fd. */ fd = anon_inode_getfd("[eventfd]", &eventfd_fops, ctx, - flags & O_CLOEXEC); + flags & (O_CLOEXEC | O_NONBLOCK)); if (fd < 0) kfree(ctx); return fd; diff --git a/trunk/include/linux/eventfd.h b/trunk/include/linux/eventfd.h index a6c0eaedb1b0..a667637b54e3 100644 --- a/trunk/include/linux/eventfd.h +++ b/trunk/include/linux/eventfd.h @@ -10,11 +10,12 @@ #ifdef CONFIG_EVENTFD -/* For O_CLOEXEC */ +/* For O_CLOEXEC and O_NONBLOCK */ #include /* Flags for eventfd2. */ #define EFD_CLOEXEC O_CLOEXEC +#define EFD_NONBLOCK O_NONBLOCK struct file *eventfd_fget(int fd); int eventfd_signal(struct file *file, int n);