This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 4fbfb1742e26297d1753cc94212806d80d7950a9 Author: Marco Casaroli <[email protected]> AuthorDate: Wed Nov 11 23:02:33 2026 +0100 include/sys/poll.h: Give POLLRDHUP the value of Linux. POLLRDHUP has the value of POLLHUP, so a caller cannot tell them apart. A program can treat POLLHUP as "read and write", and POLLRDHUP as "the peer closed": if ((what & EPOLLHUP) && !(what & EPOLLRDHUP)) ev = EV_READ | EV_WRITE; else if (what & EPOLLRDHUP) ev |= EV_CLOSED; With one value a hang-up is always the second case. A reader or a writer that did not ask for that event does not run, and the program calls epoll_wait() again at once. POLLRDHUP now has the value of Linux, 0x2000. It fits the short of struct pollfd. EPOLLRDHUP has the same value. No driver reports it yet. This changes the value of a constant in the ABI. A program that was built with the old value asks for POLLHUP and gets POLLHUP, as before. It must be built again to tell the two apart. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- include/sys/poll.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/sys/poll.h b/include/sys/poll.h index 952dd5bde05..e1cf5bcdf78 100644 --- a/include/sys/poll.h +++ b/include/sys/poll.h @@ -62,6 +62,10 @@ * Device has been disconnected (revents only). * POLLNVAL * Invalid fd member (revents only). + * POLLRDHUP + * Socket: no more data comes in. The peer closed the connection or + * shut down its writing half, or shutdown(SHUT_RD) was called (Linux + * extension, with the value of Linux). */ #define POLLIN (0x01) /* NuttX does not make priority distinctions */ @@ -76,8 +80,8 @@ #define POLLERR (0x08) #define POLLHUP (0x10) -#define POLLRDHUP (0x10) /* NuttX does not support shutdown(fd, SHUT_RD) */ #define POLLNVAL (0x20) +#define POLLRDHUP (0x2000) /**************************************************************************** * Public Type Definitions
