feat(libc): implement __inet_ntoa #2208
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2208"
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 reyani-dev on 2026-10-09T11:36:43Z.
What
Exports
__inet_ntoa(the symbol behindinet_ntoa). It formats the four address bytes in network (memory) order as dotted decimal, as FreeBSD'slib/libc/inet/inet_ntoa.cdoes. Thestruct in_addrargument is passed by value; under the SysV ABI that is the 32-bit integer inedi, so the parameter is declaredunsigned int.FreeBSD returns a static buffer; this uses a per-thread buffer like
basenamein the same file, so concurrent callers don't overwrite each other's result. Each call still reuses the same buffer, which the test checks.Titles: from the #1578 audit, imported from
libSceLibcInternal(resolved throughlibc.prx) by PPSA99169 RetroArch, PPSA99764 Porpoise and PPSA99420 PS5MC. I haven't run any of these titles.Related: #1848 (
__inet_aton) and #1972 (__inet_addr) add the parsing side in the same file. This change sits afterbasenameand adds no includes, so it merges cleanly with both and with #1812 (checked withgit merge-tree).Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release,
-DBUILD_TESTING=ON:guest_string_tests, next tobasename:127.0.0.1,255.255.255.255,0.0.0.0,10.200.3.45;100.9.99.0, for a zero tens digit and single digits;guest_stringsfail.cmake --build build --target libs: the patchedlibc.prxexports6i5aLrxRhG0.tools/check_conventions.pypasses, andtools/pr_overlap.py --branchreports no overlap.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 github-actions[bot] on 2026-10-09T11:37:08Z.
Progress report (
c72d5ce→471e537)➖ System libraries: 85.7% (+0.0%, +1 implemented functions)
✅ 1 implemented
__inet_ntoa_nid_postfixImported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-09T11:54:19Z.
Full Linux and Windows builds and tests for this head (
5e4bf8ec), using the project's Build workflow. I can't start the upstream manual run, so I ran the samebuild.ymlin my fork through a mirror PR. Like the upstream run, the jobs check out the PR head merged into currentmain(d70b8998):ctest: 516/516 passedctest: 507/507 passedRun: https://github.com/AchrafReyani/AnyPS5/actions/runs/37924809143
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T12:33:55Z.
PR #2231 is now the canonical, more complete IPv4-helper change. It includes this implementation along with the other parsing/formatting helpers, preserves the original author commits in its history, and adds cross-function round-trip coverage. The exact head has a local Linux full-build result with the documented GCC 12 SaveData workaround, and I requested the upstream Build. Please close this overlapping PR as superseded once the current-head Build on #2231 is reviewed.
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-09T12:35:46Z.
Thanks for consolidating these. I checked #2231: my
__inet_ntoacommit is in its history unchanged apart from the rebase (9f299a93), and the round-trip tests are a good addition. I'll close this PR as superseded once the Build on #2231's current head has been reviewed.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T17:36:35Z.
Thanks for confirming that your
__inet_ntoacommit is retained in #2231. I still consider my #2231 the better canonical merge target for this IPv4 helper family: it includes your formatter with__inet_atonand__inet_addr, plus cross-function round-trip tests.The exact #2231 head
6923a54enow has a Windowsguest_stringspass with no skipped cases. Its aggregate 519/519 CTest run needed local fixes to unrelated #1611, #1796, and #1824, so the required unmodified upstream Build is still pending. Please keep #2208 open until that Build is reviewed and a maintainer confirms the one-PR shape.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T17:42:17Z.
Update after rebase: #2231 is now on current
main(f8c2f072) at863ff49f; its Linuxguest_stringstest passes 1/1 and Conventions passes. The Windows results in its description are from the pre-rebase head6923a54e, not this head, and the exact-head upstream Build is still pending.I still consider #2231 the better canonical target for the IPv4 helper family because it preserves and combines the three implementations and adds cross-function tests. The overlapping PRs remain open until maintainers decide whether this cohesive family should land together; I am not treating the old Windows batch as current-head validation.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:15:15Z.
Please keep this open. #1848 and #1972 go in as they are, and this one after them: RetroArch and Porpoise stop at
__inet_ntoaonce__inet_addrexists (CouchRiv's run on #2231). #2231 is being closed in favour of the three single PRs.Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-10T03:45:54Z.
Rebased onto current
main(471e537c) now that #1848 and #1972 are in. There were no conflicts.On Windows,
guest_stringsandguest_address_conversionpass,ctest -E "^agc_|video_out"is 297/297, andcheck_conventions.pypasses. The full Linux and Windows build for this head is running and will be posted here.Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-10T04:14:32Z.
Full Linux and Windows builds and tests for this head (
471e537c), using the project's Build workflow. I can't start the upstream manual run, so I ran the samebuild.ymlin my fork through a mirror PR. Like the upstream run, the jobs check out the PR head merged into currentmain(d70b8998):ctest: 587/587 passedctest: 573/573 passedRun: https://github.com/AchrafReyani/AnyPS5/actions/runs/38021686529