/* * include/linux/eventpoll.h ( Efficient event polling implementation ) * Copyright (C) 2001,...,2006 Davide Libenzi * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Davide Libenzi * */ #ifndef _LINUX_EVENTPOLL_H #define _LINUX_EVENTPOLL_H #include #include #define EPOLL_CLOEXEC O_CLOEXEC #define EPOLL_CTL_ADD 1 #define EPOLL_CTL_DEL 2 #define EPOLL_CTL_MOD 3 #define EPOLLONESHOT (1 << 30) #define EPOLLET (1 << 31) #ifdef __x86_64__ #define EPOLL_PACKED __attribute__((packed)) #else #define EPOLL_PACKED #endif struct epoll_event { __u32 events; __u64 data; } EPOLL_PACKED; #ifdef __KERNEL__ struct file; #ifdef CONFIG_EPOLL static inline void eventpoll_init_file(struct file *file) { INIT_LIST_HEAD(&file->f_ep_links); INIT_LIST_HEAD(&file->f_tfile_llink); } void eventpoll_release_file(struct file *file); static inline void eventpoll_release(struct file *file) { if (likely(list_empty(&file->f_ep_links))) return; eventpoll_release_file(file); } #else static inline void eventpoll_init_file(struct file *file) {} static inline void eventpoll_release(struct file *file) {} #endif #endif #endif