feat(libc): implement guest gethostname #2968
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2968"
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 babyhuey on 2026-10-10T18:59:47Z.
What
Implements
gethostname(-nvxBWa0iDs) in libc. The commits are @QRMOE's, from #2019 (their updated branch at a4e3ff0d, rebased ontomainwith their authorship kept and the two merge commits dropped). They can't open PRs yet because of the intake check and asked me to open it.It reports the fixed guest name
AnyPS5and never queries the host machine name, which answers the review point on #2019 about handing the PC's name to the guest. Buffer copying, a null buffer andENAMETOOLONGfollow FreeBSD gethostname, and the caller's errno is kept on success. TechnicalDebt records the fixed-name policy and that the console's configurable hostname and itssysctland resolver integration are not implemented.XashPS5 (PPSA19111) stops at it on
main9c5d67fb, and PS5MC (PPSA99420) reaches it afterexecvp(#2827). Catalog builds,eboot.binandsce_module/libc.prxunwrapped as #2605 requires (tracked in #1578):main, Linux:app.elf: symbol lookup error: app.elf: undefined symbol: -nvxBWa0iDsmain, Windows:FAIL: unresolved ELF import -nvxBWa0iDs (gethostname) from libSceLibcInternal.prxapp.elf: symbol lookup error: app.elf: undefined symbol: vhtcIgZG-Lk(realpath)Tested
Linux (Ubuntu 24.04, GCC 13, Release) on
9c5d67fb:guest_hostnameandguest_errorspass 5/5 (--repeat until-fail:5), and the XashPS5 line above. QRMOE ran the full Windows build onmain5edae353with both tests passing 5/5.check_conventions.pypasses. Windows 11 (MinGW-w64 GCC 15.2 from WinLibs, Release) on the same commit: both tests 5/5 with no warnings, and XashPS5 stops atFAIL: unresolved ELF import vhtcIgZG-Lk (realpath) from libSceLibcInternal.prx.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T19:23:07Z.
Progress report (
4a747c4→f153c28)➖ System libraries: 84.48% (+0.0%, +1 implemented functions)
✅ 1 implemented
gethostname_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T22:02:51Z.
Checked on Linux (Release, merged onto current
main):guest_hostnamepasses 5/5, and the rest of the libc/libs ctest scope is green.gethostnamematches FreeBSDgethostname.c(truncated copy andENAMETOOLONGwhen the buffer is short, null buffer returns 0, errno kept on success), the name is fixed and never read from the host, and the TechnicalDebt entry is in the right section. Windows and the title runs rest on your and @QRMOE's reports. Merging.