.quad compat_sys_timerfd_gettime
.quad compat_sys_signalfd4
.quad sys_eventfd2
+ .quad sys_epoll_create2
ia32_syscall_end:
.long sys_timerfd_gettime
.long sys_signalfd4
.long sys_eventfd2
+ .long sys_epoll_create2
* RB tree. With the current implementation, the "size" parameter is ignored
* (besides sanity checks).
*/
-asmlinkage long sys_epoll_create(int size)
+asmlinkage long sys_epoll_create2(int size, int flags)
{
int error, fd = -1;
struct eventpoll *ep;
+ if (flags & ~EPOLL_CLOEXEC)
+ return -EINVAL;
+
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d)\n",
current, size));
* Creates all the items needed to setup an eventpoll file. That is,
* a file structure and a free file descriptor.
*/
- fd = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep, 0);
+ fd = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep,
+ flags & O_CLOEXEC);
if (fd < 0)
ep_free(ep);
return fd;
}
+asmlinkage long sys_epoll_create(int size)
+{
+ return sys_epoll_create2(size, 0);
+}
+
/*
* The following function implements the controller interface for
* the eventpoll file that enables the insertion/removal/change of
#define __NR_timerfd_gettime 326
#define __NR_signalfd4 327
#define __NR_eventfd2 328
+#define __NR_epoll_create2 329
#ifdef __KERNEL__
__SYSCALL(__NR_signalfd4, sys_signalfd4)
#define __NR_eventfd2 290
__SYSCALL(__NR_eventfd2, sys_eventfd2)
+#define __NR_epoll_create2 291
+__SYSCALL(__NR_epoll_create2, sys_epoll_create2)
#ifndef __NO_STUBS
#ifndef _LINUX_EVENTPOLL_H
#define _LINUX_EVENTPOLL_H
+/* For O_CLOEXEC */
+#include <linux/fcntl.h>
#include <linux/types.h>
+/* Flags for epoll_create2. */
+#define EPOLL_CLOEXEC O_CLOEXEC
/* Valid opcodes to issue to sys_epoll_ctl() */
#define EPOLL_CTL_ADD 1
asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
fd_set __user *exp, struct timeval __user *tvp);
asmlinkage long sys_epoll_create(int size);
+asmlinkage long sys_epoll_create2(int size, int flags);
asmlinkage long sys_epoll_ctl(int epfd, int op, int fd,
struct epoll_event __user *event);
asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events,