feat(libc): implement __inet_addr #1974
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1974"
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 CouchRiv on 2026-10-09T03:31:44Z.
What
Three homebrew apps from the PS5 homebrew catalog stop at load on
mainf1451396: XashPS5 (PPSA19111 1.3), RetroArch (PPSA99169 1.0.0-beta.1) and Porpoise (PPSA99764 2.7).7p7kTAJcuGgis__inet_addr, imported fromlibSceLibcInternal. FreeBSD's libc exportsinet_addrunder that name too (__weak_reference(__inet_addr, inet_addr)), and nothing provides it yet. RetroArch and Porpoise were also reported stopping there in #1578.This adds
__inet_addrto libc, followinginet_addrandinet_atonin FreeBSD'slib/libc/inet/inet_addr.c:0) or hex (0x); the last part fills the remaining bytes, so127.1is127.0.0.1;INADDR_NONE(0xffffffff) for invalid input, so255.255.255.255and an error look the same, as on FreeBSD;4294967297gives0.0.0.1), like FreeBSD. glibc rejects it, so the host'sinet_addris not used.#1766 added
__inet_addrand__inet_ntoathrough the host's functions and was closed because no title stopped on them yet; LeandroLP23 later asked to reopen it when RetroArch and Porpoise were seen stopping here. This PR is__inet_addralone;__inet_ntoa, the next stop, follows in its own PR. #1848 (__inet_aton) follows the same FreeBSD function; the two merge without conflicts.Tested
CachyOS Linux, GCC 16.2.1, Release, RTX 4070 Ti (NVIDIA 615.71.09) and Radeon 610M (RADV, Mesa 26.2.4):
-nvxBWa0iDs(gethostname), RetroArch and Porpoise at6i5aLrxRhG0(__inet_ntoa).guest_stringshas new checks: the four address forms, hex and octal parts, the largest last part of each form, trailing whitespace,255.255.255.255, and 15 invalid inputs (an empty string, a leading space, five parts, parts out of range,08,1..2, letters, trailing garbage, a bare0x, a trailing dot, a sign).tools/check_conventions.pyandgit diff --checkpass.Not tested on Windows or on a console. The behaviour comes from FreeBSD's source and was not measured on a PS5.
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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by CouchRiv on 2026-10-09T03:37:27Z.
Closing as a duplicate of #1972, which was opened first and implements the same
__inet_addr. With__inet_addr, RetroArch (PPSA99169) and Porpoise (PPSA99764) move on to__inet_ntoa(6i5aLrxRhG0) and XashPS5 togethostname;__inet_ntoawill follow in its own PR.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T03:38:34Z.
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.
main)core/libs/tests/GuestStrings.cppL1__inet_addr_nid_postfixPull request closed