Drop EPOLLWAKEUP from epoll events mask if CONFIG_PM_SLEEP is disabled.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -61,5 +61,16 @@ struct epoll_event { · 60 unmodified lines | ||
| 61 | 61 | __u64 data; |
| 62 | 62 | } EPOLL_PACKED; |
| 63 | 63 | |
| 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 | |
| 65 | 76 | #endif /* _UAPI_LINUX_EVENTPOLL_H */ |