Repository navigation
Conversation
Numeric names follow FreeBSD 11.4 inet_aton and are answered without a lookup; other names are resolved by the host (Winsock gethostbyname on Windows, glibc gethostbyname_r on Linux) and copied into a FreeBSD-layout hostent held in per-thread storage. An empty name, an IPv6 literal or a name longer than 255 characters fails without a lookup; a null name throws. h_errno is not set; the gap is recorded in TechnicalDebt. Refs boykopovar#1578 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 8, 2026
|
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.
|
This was referenced Oct 9, 2026
Collaborator
|
Closing: no log shows a title stopping at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements
gethostbyname(NID5T4SHQqzoGo) inlibScePosixForWebKit. Partially addresses #1578: EVO-PLAYER-PS5 (PPSA99039), PS5VR (PPSA99177), and Nuvio PS5 (PPSA99997) import this function, which is currently unresolved.Signature:
struct hostent *gethostbyname(const char *name);Guest ABI: Uses the FreeBSD LP64
hostentlayout from the PS5 Payload SDK's [FreeBSD 11.4 netdb.h](https://github.com/ps5-payload-dev/sdk/blob/f7fd02e6e195902a449b5e664917be8c01888b34/include/freebsd/netdb.h#L104-L111). The structure is 32 bytes, withh_nameat offset 0,h_aliasesat 8,h_addrtypeat 16,h_lengthat 20, andh_addr_listat 24. Compile-time assertions verify the layout. Winsock uses different field types, so native host structures are never returned directly.Numeric IPv4 resolution: Implements FreeBSD 11.4
[inet_aton](https://github.com/freebsd/freebsd-src/blob/releng/11.4/lib/libc/inet/inet_addr.c)parsing, supporting abbreviated addresses, hexadecimal and octal components, single-integer representations, and trailing whitespace. Numeric addresses are resolved locally without network access, following FreeBSD's[fakeaddr](https://github.com/freebsd/freebsd-src/blob/releng/11.4/lib/libc/net/gethostnamadr.c#L430-L481)behavior.Hostname resolution: Uses native Winsock
gethostbynameon Windows and glibcgethostbyname_ron Linux, with buffer growth onERANGE. Canonical names, aliases, and IPv4 addresses are deep-copied into guest-compatible structures. Results with invalid address families, address lengths, or missing required fields are rejected.Result storage: Maintains one result per thread, following FreeBSD's
[NETDB_THREAD_ALLOC](https://github.com/freebsd/freebsd-src/blob/releng/11.4/lib/libc/net/netdb_private.h#L33-L55)behavior. Each subsequent call replaces that thread's result without affecting other threads. Storage is released at thread exit, and failed storage construction preserves the previous result.Error handling: Failed lookups return
NULL. Empty names, IPv6 literals, and names exceeding 255 characters are rejected without a hostname lookup. Null pointers throw rather than causing undefined behavior.Known limitation:
h_errnois not propagated to the guest's libc-visible error location. Firmware 3.20 [module exports](https://github.com/DNNDHH/PS5-3.20_Libs) do not expose anh_errnoaccessor, while the PS5 Payload SDK maps__h_errnotosceNetErrnoLocin its own[libc/netdb.c](https://github.com/ps5-payload-dev/sdk/blob/f7fd02e6e195902a449b5e664917be8c01888b34/libc/netdb.c). The console's corresponding behavior is unverified, so no speculative cross-library error-state changes are introduced. This and other host-dependent resolver differences are recorded inTechnicalDebt.md.Existing
getaddrinfo,getnameinfo,freeaddrinfo, andgai_strerrorimplementations remain unchanged.Tested
Not built or executed locally. The development machine does not have the required toolchain installed. Compilation and runtime validation are pending through the Linux and Windows Build workflow jobs.
Added regression coverage to
guest_resolverfor:hostentsize and field offsets.::1,::ffff:127.0.0.1), oversized names, and null pointers.hostentfixtures containing aliases and multiple addresses.All test inputs are deterministic and avoid external DNS access.
The resolver test target now links
libcand configures Windows exception unwinding consistently with the project's existing test patterns.Verification status:
git diff --checkpassed.check_conventions.pyandcheck_test_registration.pywere reviewed manually but not executed because Python was unavailable.No title was run. Other missing imports tracked in #1578 may still prevent the affected titles from starting.
Overlap: #1637 (
arc4random_buf) and #1613 (mkstemp,isatty) modify the same library, while #1128 reformatsResolver.cpp. None implementsgethostbyname; a rebase may be necessary depending on merge order.Checklist
main(4ddbf049at branch creation); no other open PR implements the same functionNotImplemented_nid_no_patch); no silent stubs introduced.mdfiles or images added to the repository