feat(libc): implement devname and devname_r #14864
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14864"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Jawschamp on 2026-11-01T21:13:21Z.
What
Implements
devnameanddevname_r(libSceLibcInternal NIDsfqLrWSWcGHwandBIALMFTZ75I) in libc, following FreeBSD 11.4lib/libc/gen/devname.c. Both returned the NID-literal placeholderslibSceLibcInternalUnknown_*_nid_no_patchbefore; those are removed, as in36ea3f125, and the two rows are removed fromdocs/dev/debt/libSceLibcInternal.mdwith its counts updated.NODEVgive#NODEV. Character devices give#C:0x<hex>and block devices#B:0x<hex>, written into the caller's buffer withstrlcpytruncation.devnameformats into a static 64-byte buffer throughdevname_r.kern.devnameis never queried, so the formatted fallback is always returned. The 11.4S_ISBLK(dev)check is kept as written. Both are documented indocs/dev/debt/libc.mdwith FreeBSD source links. Neither was measured on a PS5.guest_device_namecoversNODEV, non-device types, char and block formatting, truncation, theEOVERFLOWpath and the static buffer.Tested
Linux x86_64, GCC 14.2 (g++ extracted from Debian trixie packages),
-DBUILD_TESTING=ON, full configure with all submodules. Hardware and titles: not tested.libc,libSceLibcInternalandguest_device_name_tests.ctest -R guest_device_namepasses (0.01 s).devname_nid_postfixanddevname_r_nid_postfixare exported bylibc.prx.core/libs/tests/test_public_headers.py --audit-onlypasses (one declaration per export).tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.tools/pr_overlap.py --branch feat/libc-devnamefinds no PR with the same exports or new files. It reports textual overlap only in neighbouring lines of the debt docs,Api.hpp,CMakeLists.txtand the inventory files; the branches it could not compare were checked by hand, and none of them adds or changesdevname,devname_r,BIALMFTZ75IorfqLrWSWcGHw.kern.devname.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)Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T02:06:13Z.
Review: APPROVED
Windows 11, WinLibs GCC 15.2.0 r7, Release. Head
a4faa2f0b6merged into upstream/main93dbd0f82a:guest_device_namepasses. WithoutDeviceName.cppthe test doesn't link, as expected for new exports.devnameanddevname_rhash tofqLrWSWcGHwandBIALMFTZ75I. Both are defined entries in the dynamic symbol table of firmware 13.42'slibSceLibcInternal.sprx(objdump -T; behaviour not run).Read against FreeBSD 11.4's
devname.c:%#jxprints a zero device without the0xprefix, and the code and test have#C:0.S_ISBLK(dev)check on the device number rather than the type is kept and documented as the source has it. That's the right call for a faithful port.