0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _LINUX_EVENTPOLL_H
0009 #define _LINUX_EVENTPOLL_H
0010
0011 #include <uapi/linux/eventpoll.h>
0012 #include <uapi/linux/kcmp.h>
0013
0014
0015
0016 struct file;
0017
0018
0019 #ifdef CONFIG_EPOLL
0020
0021 #ifdef CONFIG_KCMP
0022 struct file *get_epoll_tfile_raw_ptr(struct file *file, int tfd, unsigned long toff);
0023 #endif
0024
0025
0026 void eventpoll_release_file(struct file *file);
0027
0028
0029
0030
0031
0032
0033
0034 static inline void eventpoll_release(struct file *file)
0035 {
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 if (likely(!file->f_ep))
0046 return;
0047
0048
0049
0050
0051
0052
0053 eventpoll_release_file(file);
0054 }
0055
0056 int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *epds,
0057 bool nonblock);
0058
0059
0060 static inline int ep_op_has_event(int op)
0061 {
0062 return op != EPOLL_CTL_DEL;
0063 }
0064
0065 #else
0066
0067 static inline void eventpoll_release(struct file *file) {}
0068
0069 #endif
0070
0071 #if defined(CONFIG_ARM) && defined(CONFIG_OABI_COMPAT)
0072
0073 extern struct epoll_event __user *
0074 epoll_put_uevent(__poll_t revents, __u64 data,
0075 struct epoll_event __user *uevent);
0076 #else
0077 static inline struct epoll_event __user *
0078 epoll_put_uevent(__poll_t revents, __u64 data,
0079 struct epoll_event __user *uevent)
0080 {
0081 if (__put_user(revents, &uevent->events) ||
0082 __put_user(data, &uevent->data))
0083 return NULL;
0084
0085 return uevent+1;
0086 }
0087 #endif
0088
0089 #endif