Repository navigation
fix(libkernel): poll files on standard descriptors as vnodes - #10456
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
harisibrar1
left a comment
There was a problem hiding this comment.
Checked against main 6c52b64 and FreeBSD 11.4 vop_stdpoll/selscan:
- The reorder looks right to me.
File::IsVnodeonly accepts regular files, directories and archived files (S_ISREG/S_ISDIRon Linux,FILE_TYPE_DISKon Windows), so a pipe or terminal on 0-2 still takes the standard-stream fallback, and the vnode readiness matchesvop_stdpoll(no POLLPRI, no POLLHUP). - One behaviour change I'd like spelled out in the debt:
IsVnodecan't tell a guestdup2from a host redirection. Launching with< fileon Linux now makes fd 0 always readable, and Dungeons (PPSA16064) selects on fd 0, so it would start reading host stdin. With> log.txt, fd 1 and 2 become readable too. Main's poll entry (docs/dev/debt/libkernel.md:213) still says 0-2 follow the console model "whatever the host attaches to them", which is no longer true for files. Could that line be updated together with the select one? - The rewritten select entry drops two sentences that still describe current code: the
/dev/random/randomdev_pollset-reporting rule and thekqueue_pollsentence. Could they be kept, with only the standard-descriptor part changed? - The branch merges cleanly with current main. #10501's pselect goes through
select_nid_postfix, so it picks this up; #9945's NUL handles are character devices and keep the fallback (from reading only, not run on Windows).
Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
|
Thanks for the review. Updated the debt entries to cover host redirection and kept the random-device and kqueue descriptions. #9365 is now merged and included, and this branch merges cleanly. All libraries and the relinker rebuild on Linux; all 8 focused tests pass at Could you take another look? Could a maintainer also run the full Linux/Windows CI for this head? Windows hasn’t been tested locally. |
|
@alnsx #11247 rewrites the Windows |
What
selectandpollapplied the standard-stream fallback before checking whether descriptors 0–2 referred to files. An empty file duplicated onto stdin therefore reported no readiness, even at EOF.Check for a vnode first, so redirected files use the same readiness rules as files at any other descriptor. Tests cover all three standard descriptors, read/write readiness, exclusion of priority events, EOF and stream restoration.
This follows the existing FreeBSD model:
selscanpolls the file object andvop_stdpollsupplies ordinary read/write readiness. This also applies to files inherited through host redirection. Console behavior remains unmeasured.Tested
Linux 7.2.6, GCC 13.3, Release; base
e13027a1f399062d663d095ab1db139b91de0887, SPIRV-Tools disabled.0119103fa9, head7eecb44157rebuilds all libraries/relinker and passes the same 8 focused tests (Linux, 2026-10-25). This includes the merged docs(libkernel): correct three stale socket statements #9365 documentation corrections.ctest --test-dir build -R '^(guest_select|guest_poll|guest_filesystem|guest_standard_streams.*|guest_kqueue|guest_socket_descriptor_flags)$' -VChecklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)