mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
fs_epoll: serveral epoll issues fix
1. fs_epoll: try again when epoll_teardown() return 0 when poll_notify() called larger than twice when epoll_wait() blocked in the eph->sem, the semcount will be larger than 1 when epoll_wait() unblocked and will return 0 directly at the next epoll_wait. So retry to wait the eph->sem again when epoll_teardown return 0. 2. fs_epoll: poll_setup the fd again even this fd got non-expected event Some poll implementations need call poll_setup again when their internal states changed (e.g., local socket), so should add the fd to the epoll teardown list and poll_setup again at the next epoll_wait even this fd got the user non-expected event. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
@@ -61,6 +61,11 @@
|
||||
* Device has been disconnected (revents only).
|
||||
* POLLNVAL
|
||||
* Invalid fd member (revents only).
|
||||
*
|
||||
* POLLALWAYS
|
||||
* Indicate that should ALWAYS call the poll callback whether the
|
||||
* drvier notified the user expected event or not, and this value is
|
||||
* used inside kernal only (events only).
|
||||
*/
|
||||
|
||||
#define POLLIN (0x01) /* NuttX does not make priority distinctions */
|
||||
@@ -78,6 +83,8 @@
|
||||
#define POLLRDHUP (0x10) /* NuttX does not support shutdown(fd, SHUT_RD) */
|
||||
#define POLLNVAL (0x20)
|
||||
|
||||
#define POLLALWAYS (0x10000) /* For not conflict with Linux */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Type Definitions
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user