aboutsummaryrefslogtreecommitdiffstats
path: root/fs/signalfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/signalfd.c')
-rw-r--r--fs/signalfd.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/signalfd.c b/fs/signalfd.c
index ddb328b74bde..c8609fa51a13 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -205,11 +205,15 @@ static const struct file_operations signalfd_fops = {
205 .read = signalfd_read, 205 .read = signalfd_read,
206}; 206};
207 207
208asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask) 208asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask,
209 size_t sizemask, int flags)
209{ 210{
210 sigset_t sigmask; 211 sigset_t sigmask;
211 struct signalfd_ctx *ctx; 212 struct signalfd_ctx *ctx;
212 213
214 if (flags & ~SFD_CLOEXEC)
215 return -EINVAL;
216
213 if (sizemask != sizeof(sigset_t) || 217 if (sizemask != sizeof(sigset_t) ||
214 copy_from_user(&sigmask, user_mask, sizeof(sigmask))) 218 copy_from_user(&sigmask, user_mask, sizeof(sigmask)))
215 return -EINVAL; 219 return -EINVAL;
@@ -228,7 +232,7 @@ asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemas
228 * anon_inode_getfd() will install the fd. 232 * anon_inode_getfd() will install the fd.
229 */ 233 */
230 ufd = anon_inode_getfd("[signalfd]", &signalfd_fops, ctx, 234 ufd = anon_inode_getfd("[signalfd]", &signalfd_fops, ctx,
231 0); 235 flags & O_CLOEXEC);
232 if (ufd < 0) 236 if (ufd < 0)
233 kfree(ctx); 237 kfree(ctx);
234 } else { 238 } else {
@@ -250,3 +254,9 @@ asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemas
250 254
251 return ufd; 255 return ufd;
252} 256}
257
258asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask,
259 size_t sizemask)
260{
261 return sys_signalfd4(ufd, user_mask, sizemask, 0);
262}