feat(libc): implement IPv4 address helpers #1766

Closed
MarcZX10 wants to merge 1 commit from upstream-pr/1766 into main
MarcZX10 commented 2026-10-08 18:43:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T18:43:40Z.


What

Implement the missing __inet_addr and __inet_ntoa imports used by the homebrew audit in #1578. Use the host IPv4 parser and a thread-local output buffer produced by inet_ntop; initialize Winsock on Windows and link the required system library.

Tested

Linux: built libc and guest_inet_address_tests; ctest --test-dir build -R ^guest_inet_address$ --output-on-failure passed. python3 tools/check_conventions.py --base upstream/main passed. Windows and PS5 hardware not tested.

Checklist

  • Based on current main; no other open PR implements these functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no stub added
  • No notes, investigation files or images added
  • No third-party code added
  • Generic behavior
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4791305042 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1766). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T18:43:40Z. --- ### What Implement the missing `__inet_addr` and `__inet_ntoa` imports used by the homebrew audit in #1578. Use the host IPv4 parser and a thread-local output buffer produced by `inet_ntop`; initialize Winsock on Windows and link the required system library. ### Tested Linux: built `libc` and `guest_inet_address_tests`; `ctest --test-dir build -R ^guest_inet_address$ --output-on-failure` passed. `python3 tools/check_conventions.py --base upstream/main` passed. Windows and PS5 hardware not tested. ### Checklist - [x] Based on current `main`; no other open PR implements these functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no stub added - [x] No notes, investigation files or images added - [x] No third-party code added - [x] Generic behavior - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-08 19:07:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T19:07:58Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#1772 core/libs/prx/libc/CMakeLists.txt L45
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6067104295 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1766#issuecomment-6067104295). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T19:07:58Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #1772 | `core/libs/prx/libc/CMakeLists.txt` [L45](https://github.com/boykopovar/AnyPS5/blob/b858fdc48e29c3ab7476782199d8a41999d46d59/core/libs/prx/libc/CMakeLists.txt#L45) | | |
oneandonlydean commented 2026-10-08 19:22:20 +00:00 (Migrated from github.com)

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


No title reaches __inet_addr/__inet_ntoa on main yet: the homebrew audit lists the import, but those titles stop earlier at other missing imports. Closing for now; reopen when it's a title's next stop on main, with the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6067362119 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1766#issuecomment-6067362119). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T19:22:20Z. --- No title reaches `__inet_addr`/`__inet_ntoa` on main yet: the homebrew audit lists the import, but those titles stop earlier at other missing imports. Closing for now; reopen when it's a title's next stop on main, with the log line.
LeandroLP23 commented 2026-10-08 21:21:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-08T21:21:12Z.


__inet_addr is now a title's first stop on main: in @SleglJan's run of the catalog on main 4b6ab6bb (#1578), RetroArch (PPSA99169) and Porpoise (PPSA99764) both stop at it, which is the evidence asked for above, so this could be reopened. __inet_aton, where PICO-8 (PPSA99808) stops, isn't in this PR; I'll send it as a separate PR next to Network.cpp unless you'd rather add it here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069288002 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1766#issuecomment-6069288002). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-08T21:21:12Z. --- `__inet_addr` is now a title's first stop on `main`: in @SleglJan's run of the catalog on `main` 4b6ab6bb (#1578), RetroArch (PPSA99169) and Porpoise (PPSA99764) both stop at it, which is the evidence asked for above, so this could be reopened. `__inet_aton`, where PICO-8 (PPSA99808) stops, isn't in this PR; I'll send it as a separate PR next to `Network.cpp` unless you'd rather add it here.

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!1766
No description provided.