mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 00:22:57 -05:00
Implement getservbyname (H1bArJPagV0) in libScePosixForWebKit. Cloud Play (PPSA99600) imports it from this library only (registry index 408, call site 0x1042124); once fnmatch (#3545) is in, its predicted load stop is: FAIL: unresolved ELF import H1bArJPagV0 from libScePosixForWebKit.prx The ps5-payload-dev SDK stubs (f5d40f02, sce_stubs/) declare getservbyname in libScePosixForWebKit.c and not in libkernel.c or libSceLibcInternal.c. The call site is the service-name branch of a getaddrinfo inside the title: a non-numeric service is looked up with protocol "tcp", "udp" or "sctp" and the port is read big-endian at offset 16 of the result, which fixes the servent layout used here (name, aliases, 32-bit port, protocol at 0, 8, 16, 24). The guest has no /etc/services and the console's file is unknown, so the function searches 37 lines of FreeBSD 11.4 etc/services (8c639945): ftp-data, ftp, ssh, telnet, smtp, domain, tftp, http, pop3, ntp, imap, https, rtsp, submission, imaps and pop3s with their aliases and protocols, in file order. None of their names or aliases appears on an earlier line of the full file, so these lookups answer as the full file would. The search follows files_servent in lib/libc/net/getservent.c (8c639945): exact, case-sensitive match on the name or an alias, a null protocol takes the first match, the port in network byte order, the result in per-thread storage like getserv's NSS TLS state. Any other name returns null without touching errno, as for a name the file lacks. The repository's getaddrinfo still resolves service names through the host, so there was no table to share; this is recorded in TechnicalDebt.md. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
3.4 KiB
3.4 KiB
libScePosixForWebKit technical debt
Unknown function info
- gethostbyname (libScePosixForWebKit) - numeric IPv4 forms, trailing whitespace and 64-bit accumulation follow FreeBSD 11.4 inet_aton; clearing the resolver error on numeric success follows fakeaddr. Exact PS5 behavior is unverified; hostname lookup still uses the host resolver
Functional
- mkstemp and isatty (libScePosixForWebKit) follow FreeBSD's temporary-file API and terminal check, without console verification.
mkstempreplaces all trailingXcharacters, accepts a fixed name, and creates files through the guest path resolver with exclusive read/write access and mode 0600. Windows file permissions follow the existing kernel file implementation.isattytests Windows console handles rather than all character devices; files, pipes and guest sockets returnENOTTY, closed descriptors returnEBADF. - arc4random (libScePosixForWebKit) returns four bytes of host OS entropy (
getentropy,rand_son Windows), asarc4random_bufdoes, uniform over the 32-bit range like FreeBSD 11.4's RC4 keystream in arc4random.c. The console's generator and its reseeding are unknown;arc4random_uniform,arc4random_stirandarc4random_addrandomare not in the module's export set and are absent - fnmatch (libScePosixForWebKit) follows FreeBSD 11 fnmatch.c in the C locale: each byte is one character,
FNM_CASEFOLDfolds ASCII letters only, and bracket ranges compare byte values.[:class:]names are not character classes: as in FreeBSD 11 through 14,[[:digit:]]is the set of[,:,d,i,g,tfollowed by a literal](classes were added tofnmatch.cafter 14). Multibyte characters and locale collation are not modelled. A null pattern or string throws - getservbyname (libScePosixForWebKit) searches a built-in copy of 37 lines of FreeBSD 11.4's etc/services (ftp-data, ftp, ssh, telnet, smtp, domain, tftp, http, pop3, ntp, imap, https, rtsp, submission, imaps, pop3s with their aliases and protocols, in file order) the way getservent.c searches the file: case-sensitive name or alias, a null protocol takes the first match, the port in network byte order, the result in per-thread storage. The console's
/etc/servicesis unknown, so any other service returns null without settingerrno, as for a name the file lacks.getaddrinfostill resolves service names through the host's service database