History

epoll: drop EPOLLWAKEUP if PM_SLEEP is disabled

Drop EPOLLWAKEUP from epoll events mask if CONFIG_PM_SLEEP is disabled.

Amit Pundir committed 12 years ago

Commit 95f19f61 parent dc1ccc42 files · +13 −3Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/eventpoll.h+12−1
@@ -61,5 +61,16 @@ struct epoll_event { · 60 unmodified lines
6161 __u64 data;
6262 } EPOLL_PACKED;
6363
64−
64+#ifdef CONFIG_PM_SLEEP
65+static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
66+{
67+ if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND))
68+ epev->events &= ~EPOLLWAKEUP;
69+}
70+#else
71+static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
72+{
73+ epev->events &= ~EPOLLWAKEUP;
74+}
75+#endif
6576 #endif /* _UAPI_LINUX_EVENTPOLL_H */