Files
AnyPS5/docs/dev
ionut27001andClaude Opus 5.5 46f518997e fix(libc): return jrand48 and mrand48 zero-extended as measured on a PS5
In a payload process on a PS5 (firmware 12.70), jrand48 and mrand48
return the high 32 bits of the new 48-bit state zero-extended to the
64-bit long, as FreeBSD 11.0 does, so a result with bit 31 set comes
back between 0x80000000 and 0xFFFFFFFF. Here they sign-extended it, as
FreeBSD 11.1 and later do with an (int32_t) cast. lrand48 and nrand48
already matched the payload process. The tests now pin its results for
three seeds and the first six mrand48 values after srand48(1), compare
with the host as 32-bit values, and the debt entry records the
measurement.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 07:09:32 +03:00
..