The nine-slot _ZTVSt7collateIcE export added by #9979 was still zeroed, so a guest that called through the exported vtable faulted. Fill slots 2 through 8 with the same facet methods that g_collateVtable uses, leave the offset-to-top and typeinfo slots zero, and cover compare, transform, hash, retain and release through the exported object.
Walk each macOS function import before the guest entry and pass it through TraceImport_nid_no_patch, as Linux and Windows already do. An x86-64 libc build records the call and prints it on SIGABRT.
The num_put facet's eight do_put overloads build the console's printf format from the stream flags, format through snprintf and lay out the result as the SDK libc.prx does: thousands separators from the stream locale's numpunct, its decimal point, fill and width with left, right and internal adjustment, true and false names under boolalpha, and the console's prefix and infinity rules for floating point.
The time_put facet's do_put formats % with the modifier and conversion through strftime and writes the result through the output iterator's stream buffer, following the SDK libc.prx: it stores into the put area while room remains, calls overflow otherwise, and marks the iterator failed when overflow returns eof or the buffer is null.
Console libSceLibcInternal exports o4kt51-uO48 as a 104-byte STT_OBJECT;
titles that resolve the symbol as data need a zeroed 13-slot vtable like the
other facet vtables, not a missing import.
Main's #10706 moves the declarations of exported functions and their types
into the libraries' public headers, and gives WaitForPendingInSet a
KernelTimespec timeout. The merge keeps this branch's DeliverUnblockedPending
and ChangeBlockedMask with main's KernelTimespec. It takes main's side of
the declarations in GuestSignalSets.cpp, whose setjmp and longjmp this
branch had added and libc's Api.hpp now declares. GuestSignalHandlerMask.cpp
includes the libkernel and libc public headers in place of its own
declarations and GuestSignalSet and GuestSigaction types, as the
public_headers audit requires.
%G, %g and %V no longer throw for a negative tm_yday, a tm_yday past the year or a tm_wday below -6. They follow the year and week rule of the SDK libc.prx, read from its disassembly and checked by running it, with its leap-year test and 32-bit arithmetic. %U and %W also wrap in 32 bits as that module does.
std::condition_variable_any regressed guest_libc_cnd_timed_wait on the Windows runner. Keep CRITICAL_SECTION/CONDITION_VARIABLE on Windows and poll TryEnterCriticalSection for _Mtx_timedlock.
log1p returned the host's log1p, whose last bit differs from the titles'
copy on Windows on 24,477,433 of 320 million random arguments. The titles'
copy is FreeBSD msun's s_log1p.c, and it sets EDOM at msun's NaN return,
for arguments below -1, -inf and negative NaNs, but not for log1p(-1).
log1p now computes that algorithm and sets EDOM there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both libc debt entries said the console behaviour was unverified. The
libc.prx that PPSA13934 ships in sce_module/ settles them (read from
disassembly, not measured on a console):
- _Mtx_trylock (0x5cf0) passes its argument to scePthreadMutexTrylock
and returns 0 on success, 3 for SCE_KERNEL_ERROR_EBUSY and 4 for any
other error.
- strdup (0x6b440) calls strlen and strndup (0x6b650) calls strnlen on
the source with no null check, so both fault on a null source, except
strndup(NULL, 0), which returns an empty copy where this libc returns
null with EINVAL.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add the long-double siblings of _Cosh and _Sinh with the same scaled finite-input path, signed-zero handling and Dinkumware two-argument contracts. The reductions use a long-double ln2 split, and the scaled-range tests pin 64-bit results instead of the intermediate writer's output. Cover known values, signs and non-finite inputs in guest_math; record the unverified console results and exception behavior in the libc debt list.
The printf family formatted floating-point conversions through the host,
which prints every exact digit and rounds ties to even. The libc.prx
that titles ship keeps the exact digits only down to a position derived
from the binary exponent and prints zeros after them, rounds half up on
the kept digits, and rounds an exact tie down once that exponent
estimate reaches 8. So %.0f of 2.5 is 3 and %.1f of 0.25 is 0.3 there,
and %.20f of 0.1 is 0.10000000000000000555.
Format finite double and long double e, f and g conversions with those
rules from exactly generated digits, on every host. On 600,000 random
formats every output with up to 17 significant digits now matches the
copies bundled with PPSA07923, PPSA05916 and PPSA13934; longer outputs
still differ where the console's extended-precision digits end one unit
lower.
Co-Authored-By: Claude Opus 5.5 <[email protected]>