feat(libScePosixForWebKit): implement gethostbyname_r #14157
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14157"
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 danielhorngt on 2026-10-31T21:17:58Z.
What
Implements
gethostbyname_rin libScePosixForWebKit (scePosixForWebKit_gethostbyname_r, NIDdt8ermYp-Wc), which threw until now. The signature and behaviour follow FreeBSD 11.4 gethostnamadr.c and gethostbydns.c:__copy_hostent's layout: aligned to 8 bytes, then the address and alias pointer lists, the addresses, the name and the aliases.ERANGEwithNETDB_INTERNALand writes nothing to the entry or buffer.*h_errnopand*resultnull. A success leaves*h_errnopunwritten.gethostbynameandgethostbyname_rnow shareResolveHost, each with its own thread-local storage, so_rdoes not overwrite an earliergethostbynameresult.One change reaches beyond the new export: numeric names are cut to
MAXDNAME(1025) bytes, asfakeaddrdoes, and this also applies togethostbyname.The debt entry records what is unverified, including that FreeBSD retries a numeric name that does not fit through
/etc/hostsand DNS where this returnsERANGE. The old entry said this export had no credible prototype; FreeBSD's public header and source supply one, though no console or WebKit caller was read to confirm it.Tested
Windows 11, WinLibs GCC 15.2.0, Release, on the rebased branch. No title or homebrew was run; I found no title that calls this export.
ctest -R 'guest_(resolver|raw_resolver|service_database|posix_wrap)$': 4 of 4 pass. The new cases inguest_resolverpin the exact buffer layout, the exact fitting size, an unaligned buffer,ERANGEone byte short, the 1025-byte cut, a failed lookup,localhost, a preservedgethostbynameresult and a null name.ctest -R '^public_headers'(before the rebase): 65 of 65 pass.guest_resolverfail. Reverted.check_conventions.py --base upstream/mainpasses.Not run: the full test suite, the
libstarget, Linux, macOS, or any comparison with a console.pr_overlap.pyexited non-zero, so I compared the two PRs it reported. #13141 (mkostemp) edits a neighbouring line of the debt file. #5021 (ARM64 AOT) touchesResolver.cpponly as a stale copy from an older base, and could not be compared automatically. Neither implements this function.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T21:21:26Z.
Review: COMMENTED
Reviewed — Linux verification pending
At head
6193262cfc6252e3bc1166ee55030c3a92259937, source inspection found no concrete defect, but approval is withheld until the changed Linux resolver branch is exercised.The no-build precheck passed diff, conventions, and dependency/mergeability checks; the ABI audit passed with the expected explicit-export-alias warning, and I confirmed
guest_resolveris registered in CMake. The author reports 4/4 focused tests on Windows and 65/65 public-header tests before the rebase; I did not run those tests. The current hosted checks are still queued, and Linux/macOS resolver tests are not reported. Please provide an exact-head Linuxguest_resolverrun (and macOS too if available). I did not build or run C++ tests locally.