AnyPS5/core/libs/prx/libScePosixForWebKit
screamm 8b9529b99a fix(libScePosixForWebKit): keep the getservbyname result trivially destructible
The per-thread servent storage held std::string and std::vector
members, so getservbyname_nid_postfix registered a thread_local
destructor through __cxa_thread_atexit. On Windows that destructor runs
after emulated TLS freed the object, and prx_thread_local_destructors
(#4029) rejects libScePosixForWebKit.prx for it.

The result now lives in a thread_local struct of fixed-size char arrays
and an alias pointer array, sized for the longest name (submission),
alias (www-http), protocol (sctp) and alias count in the embedded table;
static_asserts check the sizes against the table and that the struct is
trivially destructible. The guest servent layout and the per-thread
result FreeBSD's getservent.c keeps in its NSS TLS state are unchanged.
Nothing is allocated, so the ENOMEM path is gone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-13 15:43:05 +03:00
..
CMakeLists.txt feat(libScePosixForWebKit): implement getservbyname 2026-10-13 15:43:05 +03:00
Export.cpp fix(libs): take guest entropy from the host OS instead of std::random_device 2026-10-11 22:07:49 -03:00
Filesystem.cpp fix(libkernel): give guest sockets ordinary descriptor numbers below FD_SETSIZE 2026-10-13 03:22:36 +00:00
GuestResolver.hpp feat(libScePosixForWebKit): implement getservbyname 2026-10-13 15:43:05 +03:00
Resolver.cpp fix(libScePosixForWebKit): keep the getservbyname result trivially destructible 2026-10-13 15:43:05 +03:00