diff options
| author | Davide Libenzi <davidel@xmailserver.org> | 2002-12-09 01:31:50 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-12-09 01:31:50 -0800 |
| commit | ebdef6d5bec6fd340ee07c8b888e2bb4d97797c4 (patch) | |
| tree | e712dd3a02ba5fcccbe7d7e6e8d633c3ae07fe6f /include/linux/eventpoll.h | |
| parent | 5e6c072f732d9c711c7c56ee0e46b0858ab01702 (diff) | |
[PATCH] epoll bits 0.59 ...
- Finalized the interface by :
* Having an epoll_event structure instead of using the pollfd
* Adding a 64 bit opaque data member to the epoll_event structure
* Removing the "fd" member from the epoll_event structure
* Removing the "revents" member to leave space for a unique 32 bit
"events" member
- Fixes the problem where, due the new callback'd wake_up() mechanism
loops might be generated by bringing deadlock or stack blow ups.
In fact a user could create a cycle by adding epoll fds inside
other epoll fds. The patch solves the problem by either :
* Moving the wake_up() call done on the poll wait queue head,
outside the locked region
* Implementing a new safe wake up function for the poll wait queue
head
- Some variable renaming
- Changed __NR_sys_epoll_* to __NR_epoll_* ( Hanna Linder )
- Blocked the add operation of an epoll file descriptor inside itself
- Comments added/fixed
Diffstat (limited to 'include/linux/eventpoll.h')
| -rw-r--r-- | include/linux/eventpoll.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 4e3a5978adac..64ba5c38f2a6 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h @@ -16,22 +16,25 @@ /* Valid opcodes to issue to sys_epoll_ctl() */ -#define EP_CTL_ADD 1 -#define EP_CTL_DEL 2 -#define EP_CTL_MOD 3 +#define EPOLL_CTL_ADD 1 +#define EPOLL_CTL_DEL 2 +#define EPOLL_CTL_MOD 3 +struct epoll_event { + __u32 events; + __u64 data; +}; #ifdef __KERNEL__ /* Forward declarations to avoid compiler errors */ struct file; -struct pollfd; /* Kernel space functions implementing the user space "epoll" API */ asmlinkage int sys_epoll_create(int size); -asmlinkage int sys_epoll_ctl(int epfd, int op, int fd, unsigned int events); -asmlinkage int sys_epoll_wait(int epfd, struct pollfd *events, int maxevents, +asmlinkage int sys_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); +asmlinkage int sys_epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout); /* Used to initialize the epoll bits inside the "struct file" */ |
