Skip to content

fix(libc): report the empty host name measured on a PS5 - #10128

Merged
oneandonlydean merged 4 commits into
boykopovar:mainfrom
orezraey:fix/libc-gethostname-measured-ps5
Oct 26, 2026
Merged

oneandonlydean merged 4 commits into
boykopovar:mainfrom
orezraey:fix/libc-gethostname-measured-ps5

Conversation

@orezraey

@orezraey orezraey commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What

gethostname returned the fixed name AnyPS5. I measured it on a retail PS5 (firmware 13.60) with a homebrew probe, from a payload process. The source and console log are in this gist (pmisc).

Call PS5
gethostname(buffer, 256) 0, errno unchanged, the buffer holds an empty string
gethostname(buffer, 1) 0, buffer[0] is 0

It now reports the same empty name. Copying, the null queries and ENAMETOOLONG for a zero-length buffer still follow FreeBSD's gethostname. The debt entry records the measurement and says that a title process, or a console with a configured name, may read another name.

sysctl kern.hostname still answers AnyPS5 here; my other change on SystemConfiguration.cpp answers the measured empty string there too.

Tested

Windows 11, MinGW (winlibs).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gist records successful gethostname calls with both 256-byte and 1-byte buffers, an empty string, and unchanged errno, matching the implementation. The code retains the existing null query and short-buffer behavior; the zero-length case is not claimed as a console measurement. GCC 12.2 syntax checks for the implementation and test passed, as did exact-worktree conventions, diff-check, and main-sync (3 ahead/29 behind; merge clean). The author reports the Windows hostname regression passing three times. The #8279 debt-file overlap concerns a separate interfaces entry, and #6044 is currently dirty against main with its broader test-file moves; neither implements this hostname behavior. Hosted checks pass and product jobs are skipped by the workflow.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 5021 docs/dev/debt/libc.md
PR 5303 docs/dev/debt/libc.md
PR 6713 docs/dev/debt/libc.md
PR 7081 docs/dev/debt/libc.md
PR 7386 docs/dev/debt/libc.md
PR 7447 docs/dev/debt/libc.md
PR 7544 docs/dev/debt/libc.md
PR 7648 docs/dev/debt/libc.md
PR 7715 docs/dev/debt/libc.md
PR 8150 docs/dev/debt/libc.md
PR 8417 docs/dev/debt/libc.md
PR 9371 docs/dev/debt/libc.md
PR 9447 docs/dev/debt/libc.md
PR 9526 docs/dev/debt/libc.md
PR 9669 docs/dev/debt/libc.md
PR 10002 docs/dev/debt/libc.md
PR 10007 docs/dev/debt/libc.md
PR 10234 docs/dev/debt/libc.md
PR 10315 docs/dev/debt/libc.md
PR 10317 docs/dev/debt/libc.md
PR 10321 docs/dev/debt/libc.md
PR 10325 docs/dev/debt/libc.md
PR 10328 docs/dev/debt/libc.md
PR 10345 docs/dev/debt/libc.md
PR 10405 docs/dev/debt/libc.md
PR 10467 docs/dev/debt/libc.md
PR 10468 docs/dev/debt/libc.md
PR 10506 docs/dev/debt/libc.md
PR 10510 docs/dev/debt/libc.md
PR 10512 docs/dev/debt/libc.md
PR 10529 docs/dev/debt/libc.md
PR 10565 docs/dev/debt/libc.md
PR 11270 docs/dev/debt/libc.md

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 23, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@orezraey Please keep the final checklist value to yes, removing the parenthetical suffix.

@orezraey

Copy link
Copy Markdown
Contributor Author

The AI-assisted line now reads yes.

@wachi35676

Copy link
Copy Markdown
Contributor

Tested head ecae349210 merged onto main 5b85225ef3, Windows 11 (WinLibs GCC 15.2.0, Release) and WSL2 Ubuntu 24.04 (GCC 13.3), BUILD_TESTING=ON.

AI-assisted: yes (Claude Code); results above were run on this machine.

@oneandonlydean
oneandonlydean merged commit c3db979 into boykopovar:main Oct 26, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants