summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/signalfd.c4
-rw-r--r--include/linux/signalfd.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/fs/signalfd.c b/fs/signalfd.c
index c8609fa51a1..5441a4bca77 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -211,7 +211,7 @@ asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask,
sigset_t sigmask;
struct signalfd_ctx *ctx;
- if (flags & ~SFD_CLOEXEC)
+ if (flags & ~(SFD_CLOEXEC | SFD_NONBLOCK))
return -EINVAL;
if (sizemask != sizeof(sigset_t) ||
@@ -232,7 +232,7 @@ asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask,
* anon_inode_getfd() will install the fd.
*/
ufd = anon_inode_getfd("[signalfd]", &signalfd_fops, ctx,
- flags & O_CLOEXEC);
+ flags & (O_CLOEXEC | O_NONBLOCK));
if (ufd < 0)
kfree(ctx);
} else {
diff --git a/include/linux/signalfd.h b/include/linux/signalfd.h
index 8b3f7b7420a..bef0c46d471 100644
--- a/include/linux/signalfd.h
+++ b/include/linux/signalfd.h
@@ -8,11 +8,12 @@
#ifndef _LINUX_SIGNALFD_H
#define _LINUX_SIGNALFD_H
-/* For O_CLOEXEC */
+/* For O_CLOEXEC and O_NONBLOCK */
#include <linux/fcntl.h>
/* Flags for signalfd4. */
#define SFD_CLOEXEC O_CLOEXEC
+#define SFD_NONBLOCK O_NONBLOCK
struct signalfd_siginfo {
__u32 ssi_signo;