feat(libc): implement gethostname #1594

Closed
MarcZX10 wants to merge 1 commit from upstream-pr/1594 into main
MarcZX10 commented 2026-10-08 14:00:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T14:00:19Z.


What

Implement gethostname using the host DNS hostname on Windows and the POSIX host call elsewhere. Stage the value before copying so a short guest buffer receives ENAMETOOLONG without partial output. Add success and error-path coverage.

Tested

Linux, GCC 12.2.0: guest_environment passed; conventions check and git diff --check passed. Windows behavior was reviewed against the platform API but was not run locally.

Checklist

  • Based on current main; no open PR implements gethostname
  • One topic per PR
  • No comments or investigation files added
  • Generic host hostname behavior
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4787941448 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1594). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T14:00:19Z. --- ### What Implement `gethostname` using the host DNS hostname on Windows and the POSIX host call elsewhere. Stage the value before copying so a short guest buffer receives `ENAMETOOLONG` without partial output. Add success and error-path coverage. ### Tested Linux, GCC 12.2.0: `guest_environment` passed; conventions check and `git diff --check` passed. Windows behavior was reviewed against the platform API but was not run locally. ### Checklist - [x] Based on current `main`; no open PR implements `gethostname` - [x] One topic per PR - [x] No comments or investigation files added - [x] Generic host hostname behavior - [x] Depends on: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-08 19:20:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T19:20:15Z.


No title reaches gethostname on main yet, and this would hand the host's machine name to the guest. Closing for now; reopen when a title stops on it, with the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6067327287 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1594#issuecomment-6067327287). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T19:20:15Z. --- No title reaches `gethostname` on main yet, and this would hand the host's machine name to the guest. Closing for now; reopen when a title stops on it, with the log line.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1594
No description provided.