Repository navigation
Conversation
Add the program cmocka_epoll_nest: a pipe in an inner epoll set, and the inner set in an outer set. The cases check that a level-triggered file that epoll_wait() reported still wakes poll() of the set and an epoll set that holds the set, as on Linux. The cases: one round of a library that gives its set to the event loop of its user, then a byte that is already there or that comes later; a stream of 20 bytes; poll() of the set; a set in a set in a set; a timerfd in the inner set. A writer thread gives the late bytes. The cases are in a new program, so the cases of cmocka_epoll do not change. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
xiaoxiang781216
approved these changes
Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
depends-on: apache/nuttx#22511
Summary
The nuttx PR above keeps a reported level-triggered file watched, so that a file that
epoll_wait()reported still wakespoll()of the epoll set and an epoll set that holds the set. This PR adds the test cases for it.This PR adds the program
cmocka_epoll_nesttotesting/fs/epoll(the same option,CONFIG_TESTING_EPOLL). Each case has a pipe in an inner epoll set and the inner set in an outer set:epoll_wait()with timeout 0 on its set, then read), then a byte that is already there or that comes 200 ms later must wake the outer set.poll()of the inner set.poll()and epoll on an epoll descriptor (ready, still ready after a report, drained, a late byte, a set in a set in a set, a timerfd in the inner set).The cases are in a new program, so the cases of
cmocka_epolldo not change.Impact
Test only. Make and CMake.
Testing
Host: macOS arm64 (Arm GNU 13.2.Rel1, QEMU 11.1 TCG). NuttX master 0c45a2fc48b, nuttx-apps master c621be6. Configs: qemu-armv8a:nsh (flat) and qemu-armv8a:knsh (kernel, the program runs from /system/bin) with cmocka, timerfd, local sockets and
CONFIG_TESTING_EPOLL. Builds with-Werror.Builds with
-Werrorin the CI image (with the options above): rv-virt:nsh64 (Make and CMake) on the nuttx PR, qemu-armv8a:nsh on master. 0 warnings (rv-virt has the RWX segment linker warning of master).tools/checkpatch.sh -c -u -m -g: pass.