Repository navigation
docs(libkernel): correct three stale socket statements - #9365
thuanquang wants to merge 1 commit into
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
|
A new open PR, #9515, now changes the same |
|
@thuanquang a merge-order note: #9515 adds |
a3725d1 to
d2e813f
Compare
|
@EagleBearerYS @MarcZX10 thanks. Agreed: this one goes first, and #9515 puts its |
Co-Authored-By: Claude <noreply@anthropic.com>
d2e813f to
66725a2
Compare
What
Three statements in
docs/dev/debt/libkernel.mdno longer matchmain; each is replaced with whatmaindoes now, and nothing else in the entries changes.selectpolls them; the other libkernel socket calls do not". On a libSceNet socket,fcntland_fcntlnow go to the status-control hook (core/libs/prx/libkernel/Socket/src/Udp.cpp:1061; registered at core/libs/prx/libSceNet/Export.cpp:928; 5dcf28d, fix(libkernel): answer fcntl status flags on libSceNet sockets #4924). That hook answersF_GETFLandF_SETFLand fails every other command withEINVAL(Export.cpp:915-917; pinned by core/libs/tests/GuestSceNet.cpp:883).pollnow waits on the native socket that the native-lookup hook returns (Udp.cpp:1714; Export.cpp:939; 62d8eea, fix(libkernel): poll libSceNet sockets with the host wait #4933). getsockopt, ioctl and the other socket calls still do not reach these sockets (Udp.cpp:1130, 1360). Now: "asselectandpollpoll them andfcntlanswersF_GETFLandF_SETFL, failing other commands withEINVAL; the other libkernel socket calls do not".closeof a libSceNet socket releases the number but leaves the libSceNet socket open".close_nid_postfixcalls the libSceNet closer first (core/libs/prx/libkernel/File/src/Stdio.cpp:728-731). That closer runssceNetSocketClose(core/libs/prx/libSceNet/Export.cpp:866-873), which erases the socket, releases the number and shuts down the native socket (Export.cpp:1016-1032). This came from 12b18af (fix(libkernel): close() and setsockopt() reach libSceNet sockets #4111), which merged before fix(libkernel): give guest sockets ordinary descriptor numbers below FD_SETSIZE #4391 added the sentence.sceKernelClosechecks only libkernel's own socket table and closes the placeholder (core/libs/prx/libkernel/File/src/Open.cpp:296-314), so the gap is still open there. Now: ", and libkernelsceKernelCloseof a libSceNet socket releases the number but leaves the libSceNet socket open".GuestSockets::FirstDescriptoris polled on the host".GuestSockets::FirstDescriptorno longer exists on main. e99816e (fix(libkernel): give guest sockets ordinary descriptor numbers below FD_SETSIZE #4391) removed it along with both range checks in select.select_nid_postfixnow moves every net entry the poller reports as unknown into the host group without a range check (core/libs/prx/libkernel/Socket/src/Socket.cpp:237-247). Now: "a descriptor the socket poller reports as unknown is polled on the host".Tested
Docs only; nothing was built or run. Rebased onto
mainf23c4b38d6: the only conflict wasmain's rewording of the next entry ([sceKernelPread ...]), which is kept as onmain. Every cited line in What was rechecked onf23c4b38d6, and the line numbers there are the current ones; the code behind the three statements is unchanged in substance (libkernel'sioctlstill sends any descriptor that is not its own socket to the file path, Udp.cpp:1361). Earlier checks: on origin/main 1698d1e I read the libSceNet hooks in libSceNet/Export.cpp (now 866-939, 1016-1032) and in libkernel's Udp.cpp (Lookup, fcntl, setsockopt, getsockopt, ioctl, connect, send, sendfile, poll); I also read select in Socket.cpp, close in Stdio.cpp, sceKernelClose in Open.cpp, the SO_ERROR path in SocketOptions.cpp, and the tests the bullets cite; I diffed the files changed since the verifiers' 99844c7 and none of the changes affects these claims. Rechecked onmain6ef5a1c: of the cited files only libSceNet's Export.cpp and GuestSceNet.cpp changed since 1896871, and the cited code only moved (Export.cpp lines 680-860 had become 860-1040, unchanged; thefcntlcheck was at GuestSceNet.cpp:778). Each statement was found by a read-only sweep of the debt files and confirmed by two independent verifier passes and a final check on currentmain.Overlap, merge order only: #9515, opened after this PR, adds
getsockoptto the [close] and [setsockopt] sentence that the first bullet corrects, and #9578 carries the same edit through #9515's commits. As agreed with their author in this thread, this PR goes first: #9515 lists it underDepends on:and puts its edit on top when it rebases. No other open pull request edits these three sentences (checked against every open PR's diff of this file on 6ef5a1c).python tools/check_conventions.py --base origin/mainwith this title and body: 0 errors and 2debt-lengthwarnings, for entries that were already over 1000 characters: select (1447 characters before, 1086 after this change); Socket descriptor numbers (1098 characters before, 1107 after this change).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)🤖 Generated with Claude Code