Repository navigation
fix(libkernel): answer fcntl status flags on libSceNet sockets - #4924
Conversation
…lTimeouts boykopovar#4924 adds a test after CheckKernelTimeouts and its call after CheckKernelTimeouts(), so placing the new check there made the two pull requests conflict.
|
Heads-up from #4910, which also touches |
|
Windows test of this PR. Environment: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, Result: guest_dup and guest_fstatfs (2 of 2; the branch is contained in #4933) pass. Not checked: whether the test fails without the change in the library code; the PR was not tested alone, only in the combined merge; no title run; Linux not tested. AI-assisted (Claude Code). |
|
Linux title run with ProsperoLight (PPSA99002, catalog release): Bazzite 44, GCC 16.2, Release, RX 7700 XT (RADV), head
Merging into current |
With libSceNet sockets on ordinary descriptor numbers (#4391), a title that makes a libSceNet socket non-blocking with plain fcntl(F_GETFL) and fcntl(F_SETFL, O_NONBLOCK) reached File::Fcntl, whose classification throws for a socket. libSceNet now registers a status control with libkernel, like its option setter: F_GETFL returns O_RDWR with the socket's non-blocking flag, F_SETFL sets it through SO_NBIO, as fcntl already does for libkernel sockets. ProsperoLight (PPSA99002) stopped here on Linux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017WeVmjnnPPKdxVTpr2Vjtw
|
Rebased onto current |
1836f8e to
5dcf28d
Compare
What
Follow-up to #4391. With libSceNet sockets on ordinary descriptor numbers, a title that makes a libSceNet socket non-blocking the POSIX way,
fcntl(fd, F_GETFL)thenfcntl(fd, F_SETFL, flags | O_NONBLOCK), reachesFile::Fcntl, whose classification throws for a socket:libSceNet now registers a status control with libkernel, the same way it registers its option setter (
KernelSetSocketStatusControl_nid_no_patch).fcntlasks it before falling back toFile::Fcntl, and for a libSceNet socket it behaves asfcntlalready does for libkernel sockets:F_GETFLreturnsO_RDWRplusO_NONBLOCKwhen set,F_SETFLappliesO_NONBLOCKthroughSO_NBIO(sosceNetGetsockoptsees the same state), flags outside the status mask fail withEOPNOTSUPPand other commands withEINVAL.This branch contains #4391's commits; the change here is the last commit (1836f8e). It only makes sense on top of #4391: on
main, libSceNet numbers can collide with host descriptors.Tested
Linux (Arch, GCC 16.2.1, Release), on #4391's head e0ec0c8 plus this commit:
CheckKernelStatusFlagsinguest_sce_net: get, set and clearO_NONBLOCKwithfcntlon a libSceNet socket, checked againstSO_NBIO, plus theEOPNOTSUPPandEINVALcases. Passes 5/5. Without the libSceNet change it aborts with thefcntl: descriptor 7 is neither a file ...error above.guest_sce_net,guest_socket_descriptors,guest_poll,guest_select,guest_dup,guest_socket_pair: all pass.--to-intel), 3 runs of 60 s: no longer stops onfcntl; its next stop ispoll: descriptor 47 is neither a socket nor a pipe, i.e.pollnot yet knowing libSceNet sockets. That is a separate change and not part of this PR.tools/check_conventions.py --base upstream/mainpasses.Checklist
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)pollnext)