Skip to content

Upstream sync 8A2: libkernel, libkernel_sys, libc and macOS path fixes - #467

Merged
RINNECODER merged 67 commits into
mainfrom
sync8/core-libs
Oct 13, 2026
Merged

RINNECODER merged 67 commits into
mainfrom
sync8/core-libs

Conversation

@RINNECODER

Copy link
Copy Markdown
Owner

Upstream sync batch 8, slice A2: libkernel, libkernel_sys, libc plus the two macOS fixes. Companion to the relinker PR (slice A was 138 commits, split to stay reviewable).

Ported

  • aa4a9b4fa bit: strtod("nan(0x123)") returned the signaling NaN
  • 3cb434715 fix(libc): clear exhausted strtok continuation state
  • 0950b1985 test(libc): cover exhausted tokenizer state
  • 22d03d497 fix(libc): terminate truncated wcsxfrm results
  • c55f377fb refactor(libc): place the NaN helpers and test includes apart from neighbouring changes
  • 61fbec8ef fix(libkernel): fail lseek on a pipe with ESPIPE on Windows
  • dbbd6d582 fix(libc): append through a descriptor opened by fdopen in an append mode on Windows
  • d31e28308 fix(libkernel): throw for unsupported directory entry names
  • c22654102 fix(libc): keep the host standard handles when a guest replaces descriptor 0, 1 or 2 on Windows
  • f8e2c6497 feat(libc): implement floor
  • 438d41082 fix(libc): keep host diagnostics on stderr when a guest redirects it on Linux
  • d04f5d600 feat(libkernel): implement sceCoredumpGetStopInfoCpu
  • 02ed28956 feat(libkernel): implement sceCoredumpGetStopInfoCpu
  • 69b9d186d fix(libc): replace an open or read-only destination in rename on Windows
  • 7aabb9005 fix(libc): fail fseek and ftell on a pipe with ESPIPE on Windows
  • 0dda76b1f fix(libc): check for a pipe on every stream seek on Windows
  • 0438621d7 fix(libkernel): getsockname on an unbound socket returns the zero address on Windows
  • ab4ccade2 feat(libc): implement _Mtx_init_with_name
  • 78ffdf052 feat(libc): implement wcsftime
  • 3a9cc6368 fix(libc): hand out the unwind cursor table through a _nid_no_patch export
  • 13444c82e fix(libc): print NaN without a sign in the guest printf formatter
  • 3fe04d4b7 feat(libc): implement atanhf
  • 572d330a1 feat(libc): implement _Cnd_timedwait
  • 64e244eb7 fix(libc): match FreeBSD acosf errno
  • 988d304c5 fix(libc): keep the acosf result and leave errno unchanged
  • 653c5449f fix(libc): honor openlog identity and facility
  • 7313cf558 docs(libc): record syslog tag fallback gap
  • 81f727c05 test(libc): match syslog PID formatting
  • 4f87ac0b1 fix(libkernel): harden DirectMemory pool bounds and rollback
  • cd0e9dccd feat(libc): implement wcscat
  • e3cef332e feat(libc): implement generic error category messages
  • 099fa80b5 fix(libc): reject invalid setlocale categories
  • 5eb99f8b6 fix(libc): reject invalid setlocale categories
  • 2ec20dbd3 fix(libc): validate guest setlocale categories
  • 1a0de9e91 fix(libc): drop unused clocale include
  • b4e2ee0a1 feat(libc): implement __powidf2
  • 90c64af92 fix(libc): export __cxa_thread_atexit
  • 9c383e329 fix(libc): ignore the guest DSO of thread atexit on Windows in the shared bridge
  • 1ab578a3f test(libc): allow the __cxa_thread_atexit export to call the MinGW registration
  • 7637cac13 fix(libkernel): place guest thread stacks inside the application area
  • 9b6e7f66c fix(libkernel): protect host-only guest stack pages
  • 745857448 test(libkernel): check the host-only stack guard on Linux only
  • 3953a8d49 feat(libc): record traced import calls on Windows
  • 0265f3363 fix(libc): choose the acosf NaN bits instead of the host libm
  • 79d88af19 test(libc): cover wide transform output bounds
  • 43ffba87e host: Windows byte-range locks are mandatory and would fail the guest's
  • 59bd0c178 feat(libkernel): accept MADV_PROTECT advisory hint in madvise
  • 8d08caa52 feat(libkernel): implement lutimes
  • c18daed28 fix(libkernel): validate CPU stop-info buffers and cover handler state
  • f37bccf6e feat(libkernel): implement pthread_atfork
  • e8fd542f0 feat(libkernel): implement pthread_atfork
  • 87f4aa331 feat(libkernel): add mlockall
  • a7ea2bdca feat(libkernel): add mlockall
  • d0df62bd1 fix(libc): format strftime and asctime as FreeBSD 11 does
  • 9efabff1c feat(libkernel): return ESRCH and EINVAL for unsupported cpuset affinity targets
  • 5c6a9d22c fix(libkernel): check and keep the scheduling policy of a thread
  • 57f0fa371 feat(libkernel): implement execv and execve as throwing exports
  • 4f1ae1cc3 feat(libkernel): implement execv and execve as throwing exports
  • 77016caa2 fix(libkernel): limit execve to unsupported behavior
  • cdf4b174f fix(libkernel): keep the execv export and its debt line
  • ae9978a98 feat(libkernel): add clock_settime with FreeBSD argument checks
  • 0f73f5f05 feat(libkernel): report the host SoC and CPU temperature
  • 204355cc6 feat(libkernel): answer the coredump user-file attach calls
  • f4be0362c fix(libc): call __dynamic_cast and __cxa_init_primary_exception with the guest ABI
  • 715413836 test(libc): register guest_dynamic_cast beside guest_array_callbacks
  • 00f058910 feat(libc): implement the float rounding and classification exports
  • f30f3e8a8 std::filesystem::canonical on macOS. Linux and Windows are unchanged.
  • libkernel_sys at-calls (mkdirat, unlinkat, renameat, fchmodat, chroot) and the rename export, hand-merged: ec0d61e 55ddffe 2a8e745 9ceb6d1 dc0d316 41b0ca5 e3c1d01 603d94a 7e5bec0 f8a269e. The fork's libkernel_sys/Export.cpp and its test were an older shape, so the upstream files were taken whole (plus Rename.cpp/General.hpp).
  • b1cf014 adapted (errno kept on localtime failure; Windows year-range part and its test not ported).
  • 52c7470 (shader cache dir on macOS): not applicable, ShaderCacheDirectory only exists for Windows in this tree.
  • f30f3e8 (executable dir on macOS): we had a fixed 4096-byte variant; replaced with the upstream size-query + canonical form in libSceFont and libSceNpEntitlementAccess.
  • macOS build fixes needed by the ports: duration_cast for the _Cnd_timedwait deadline, unistd.h for the at-calls, const_cast in the generic-category test, a GuestThreadStackHostRangeOverlaps stub in the direct-memory Darwin test harness, one guest_dynamic_cast registration.

Skipped

  • Windows-only and not clean: 1eb13fd, 7126090, 2d1cc82, a37ee5f; POLLPRI under WSAPoll (5db1d8d) was applied then dropped because its new test fails on macOS.
  • df3d027 (index DirectMemory/guest allocations by address): conflicts with the fork's Darwin DirectMemory; left for the direct-memory comparison slice.
  • 8d455b8: docs/dev/debt file is deleted in the fork.
  • Already on main (same subject): 25 commits.
  • Some Windows-only commits applied cleanly and were kept (ESPIPE on pipes, rename, console handles, call trace) to avoid re-conflicting in later syncs; they are #ifdef'd off on macOS.

Evidence

  • Rosetta set of macos-metal.yml (x86_64): builds, 16/16 ctest pass (built from the merge of both slice A PRs).
  • libc/libkernel guest tests (x86_64, run under Rosetta), 28 touched tests: 19 pass. 9 fail; 7 of them (guest_kernel_sys, guest_math, guest_thread_callback_abi, guest_filesystem, guest_kernel_is_stack, guest_kernel_stack_protect, guest_memory) fail identically on main. The two new ones, guest_host_standard_error (Linux libstdc++ abort text) and guest_mlock (mlock on a reserved range expects ENOMEM), assume Linux behaviour and are not part of the macOS CI set.
  • Game smoke: same single 220 s run as the relinker PR (merge of both): no fault or uncaught exception, in the opening cinematic at the limit, not compared to main.

Label: upstream-sync. Not merging.

🤖 Generated with Claude Code

EagleBearerYS and others added 30 commits October 13, 2026 13:56
C17 7.22.1.3 and 7.29.4.1.1 interpret NAN(n-char-sequence) as a quiet
NaN. With MinGW-w64, std::strtod, strtof and strtold are mingw-w64's
gdtoa functions, which copy the hex digits into the significand
without the quiet bit, and for long double without the x87 integer
bit: strtod("nan(0x123)") returned the signaling NaN
0x7ff0000000000123 and strtold a pseudo-NaN. A payload whose only set
bit is the implicit or x87 integer bit gave infinity:
strtof("nan(0x800000)"), strtod("nan(0x10000000000000)") and
strtold("nan(0x8000000000000000)") returned +inf. glibc returns quiet
NaNs that keep the payload.

C17 7.12.11.2p2 makes nan("n-char-sequence") equivalent to
strtod("NAN(n-char-sequence)", NULL), and nan and nanf already return
the console's fixed quiet NaNs, ignoring the tag. ParseFloat, which
strtod, strtof, strtold, atof and the wide variants share, now returns
the same values, 0x7ff8000000000000 and 0x7fc00000, negated after a
minus sign, on Windows and Linux. strtold returns the x87 default
quiet NaN, since no console nanl was observed.

(cherry picked from commit aa4a9b4)
…iptor 0, 1 or 2 on Windows

(cherry picked from commit c226541)
(cherry picked from commit f8e2c64)
…on Linux

On Linux a guest stderr redirect also moves the host's: guest
descriptors are host descriptors, and the guest stderr stream wraps the
host stderr FILE. After dup2(fd, 2), or freopen(path, mode, stderr) with
full buffering, the libc terminate report, the host fprintf(stderr)
diagnostics and libstdc++'s terminate message go into the title's pipe
or file, and abort() discards what is still buffered. RetroArch
(PPSA99169) reopens stderr onto app0/trace.txt with full buffering, so
its stop on main left no message anywhere.

Before the first guest redirect of descriptor 2 (libkernel dup2, libc
freopen of a stream on descriptor 2), keep a close-on-exec duplicate of
the host descriptor 2 and point the host stderr at an unbuffered stream
on it. The guest stream keeps its own FILE and follows the redirect.
The libc terminate report writes to the kept descriptor with write()
instead of the stderr stream, and libkernel's sceKernelDebugOutText uses
the same kept descriptor.

(cherry picked from commit 438d410)
PPSA34063 (NHL 27) calls it with a 16-byte buffer outside a coredump
handler and expects 0x81180003 there. The registered handler is never
invoked, so every call is outside one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d04f5d6)
(cherry picked from commit 02ed289)
The pipe check cached its first answer in the FileStream, so a stream
first used on a regular file stayed classified as a file after its
descriptor was replaced with a pipe (dup2 onto fileno(stream)), and a
later fseek reached the C runtime again and dropped buffered bytes.
fseeko and ftello now ask GetFileType on each call, as lseek on a pipe
does since boykopovar#4670, and FileStream no longer keeps the state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 0dda76b)
…ress on Windows

FreeBSD's in_getsockaddr and in6_getsockaddr succeed for a socket that has no
local address and return the wildcard address with port 0. Winsock fails
getsockname with WSAEINVAL until the socket is bound, which the guest saw as
EINVAL. Return the zero address of the socket's family for that error.

(cherry picked from commit 0438621)
PS5MC (PPSA99420) imports wcsftime (XbVXpf5WF28, aerolib) as the last
absent libSceLibcInternal import in its registry order (index 481), so
its predicted stop is:

    FAIL: unresolved ELF import XbVXpf5WF28 from libSceLibcInternal.prx

The stop is predicted from the import order, not observed in a run.

wcsftime follows FreeBSD 11.4 lib/libc/locale/wcsftime.c (8c639945):
the wide format is converted with wcsrtombs, strftime fills a buffer of
maxsize * MB_CUR_MAX bytes limited to maxsize, and mbsrtowcs converts
the result back. A format unit that the single-byte C locale of
lib/libc/locale/none.c cannot encode returns 0 with EILSEQ, a maxsize
whose product with MB_CUR_MAX overflows returns 0 with EINVAL, and an
empty or overflowing result or a null buffer returns 0 with errno
unchanged; the ERANGE or EINVAL set by the Windows CRT's strftime is
discarded. A null format or tm throws, as FreeBSD dereferences it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 78ffdf0)
…xport

_Unwind_Context took its cursor table from LibcUnwind::CursorSlots, a C++
data symbol of libc. On Windows LibcUnwind::Frame holds an _Unwind_Context,
so libSceAgcDriver, which builds frames for its worker sampler, imported
_ZN10LibcUnwind11CursorSlotsE from libc.prx. The NID patcher renames that
export in the patched libc and leaves the import alone, so the patched
libSceAgcDriver, libSceAgc and libSceVideoOut failed to load with error 127
and patched_libraries failed. The table is now file-local and the context
reads it through UnwindCursorSlots_nid_no_patch, which keeps its name on
both sides.

(cherry picked from commit 3a9cc63)
The guest formatter handed NaN to the host's snprintf, which prints
-nan for a negative NaN and +nan or " nan" with the + and space flags.
FreeBSD 11's vfprintf clears the sign of every NaN and prints nan (NAN
for the upper-case conversions), keeping the width and the - flag and
ignoring 0. The formatter now does the same for a, e, f and g and
their long double forms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VZWLdTjf1S57iLgn2rcaFb
(cherry picked from commit 13444c8)
Dusklight (PPSA99305) imports atanhf (cPGyc5FGjy0) from
libSceLibcInternal.prx; the libc.prx it bundles only has a zero-return
stub for it.

The implementation follows the atanhf of the libc.prx bundled with
PPSA28319 (0x438a0), read from its disassembly: FreeBSD msun's
e_atanhf.c calling msun's s_log1pf.c, both as of 59bc2f09 (stable/9,
the revision the sinhf port took expm1f and expf from). The log1pf
paths for the positive arguments atanhf passes are inlined, as the
exported log1pf is still the host's. For |x| > 1, the infinities and
NaN, Sony's error helper raises FE_INVALID and sets errno to EDOM
before returning (x - x) / (x - x); for |x| = 1 it sets errno to
ERANGE before returning x / 0. Other arguments leave errno alone.

Running that code from the title's libc.prx on a Windows host gives
the same bits, errno and floating-point exceptions as the built
libc.prx for all 2^32 arguments, and msun's own e_atanhf.c and
s_log1pf.c built with the host compiler give the same bits. With the
host log1pf instead of the msun one, 4.7% of the arguments in [0, 1)
differ. guest_math pins bits for every branch reachable from atanhf,
both signs, and the errno and exception behaviour.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 3fe04d4)
acosf returned 0xffc00000 (errno 33) for 2.0 (0x40000000), where FreeBSD
lib/msun/src/math.h returns 0xffc00000 (errno 0).

It now returns the FreeBSD result for that case. A guest test covers it
and fails on main.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
(cherry picked from commit 64e244e)
The previous commit replaced the out-of-range result with the default
quiet NaN 0x7fc00000, but main and FreeBSD e_acosf.c return 0xffc00000.

acosf now calls the host and restores errno, so only errno differs from
main. The guest test pins the result bits for 2.0f and -2.0f and keeps
the in-range case acosf(0.5f).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 988d304)
(cherry picked from commit cd0e9dc)
David and others added 18 commits October 13, 2026 13:56
mlockall (x7g7Ebeo8-U, aerolib) follows FreeBSD 11.4's sys_mlockall
(sys/vm/vm_mmap.c:1067-1131, freebsd-src
8c639945a44588f6cfdddfb057bb5aad88735da0) for the flag check: 0 or
bits outside MCL_CURRENT (1) and MCL_FUTURE (2) fail with EINVAL. The
title process is taken to pass priv_check(PRIV_VM_MLOCK), as mlock
already does.

Valid flags throw. MCL_FUTURE would need every later guest and host
mapping to be locked; nothing in the mapping paths does that, and
passing it to the host would make later host allocations fail above
the host RLIMIT_MEMLOCK. MCL_CURRENT would have to lock the whole
process, which on AnyPS5 also holds host stacks, heaps, modules and
driver mappings (sceKernelVirtualQuery reports them as guest memory),
with ENOMEM above a guest RLIMIT_MEMLOCK that is not known (getrlimit
throws for it). mlock pins host pages (VirtualLock, mlock) range by
range and keeps no record, so there is no state to extend. Recorded
in TechnicalDebt.

XPSemu (PPSA97358) calls it only with -overcommit mem-lock=on
(ZiZc3/XPSemu 8eec07b4, os-posix.c:330-355, reached from
system/vl.c:831-835):

    int flags = MCL_CURRENT | MCL_FUTURE;
    ...
    ret = mlockall(flags);
    if (ret < 0) {
        error_report("mlockall: %s", strerror(errno));
    }

and exits on failure, so that option ends in the throw; without it
the title is not affected. Predicted stop removed (registry index 201,
not run):
FAIL: unresolved ELF import x7g7Ebeo8-U from libkernel.prx

guest_mlock checks EINVAL for 0, 4, 5 and -1 and the throw for 1, 2
and 3.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 87f4aa3)
(cherry picked from commit a7ea2bd)
strftime handed most conversions to the host's strftime, which differs
from FreeBSD 11's for E and O modifiers on conversions glibc does not
pair with them (%Ea was printed literally), padding flags on %+ and %v,
years outside 1000 to 9999 (%Y printed 899 and -1 where FreeBSD prints
0899 and -001), and out-of-range fields (%I of hour 100, %u of weekday
8). On Windows the padding flags printed nothing. strftime now follows
FreeBSD 11 strftime.c with the C locale on every host, and asctime
follows FreeBSD 11 asctime.c, padding years to four digits and setting
longer years apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VZWLdTjf1S57iLgn2rcaFb
(cherry picked from commit d0df62b)
…ity targets

Allow calling threads to query and set affinity using their own thread ID in addition to -1. Return ESRCH for non-matching thread or process IDs and EINVAL for invalid level/which arguments instead of throwing NotImplemented, matching FreeBSD cpuset semantics.

(cherry picked from commit 9efabff)
On a PS5 (firmware 13.60) pthread_setschedparam and
scePthreadSetschedparam accept only SCHED_FIFO and SCHED_RR with a
priority of 256 to 767 or 896 to 959, return EINVAL otherwise, and
keep the policy for pthread_getschedparam. A created thread takes the
policy of explicit scheduling attributes, or its creator's when it
inherits. Here any policy and priority were accepted and SCHED_FIFO
was always reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5c6a9d2)
XPSemu PPSA97358 imports both from libkernel.prx; with the imports ahead
of them covered, its predicted next stops (relink registry order, not an
observed run) are:

  FAIL: unresolved ELF import KaK52lYTBIs from libkernel.prx  (execv, 7 call sites)
  FAIL: unresolved ELF import kdguLiAheLI from libkernel.prx  (execve, 4 call sites)

Today the title stops earlier at the observed
  FAIL: unresolved ELF import aRo9AhFUXcM from libkernel.prx  (sigsetjmp, merged in boykopovar#3486)

As for execvp (boykopovar#2827), the process image cannot be replaced here, so both
throw with the execvp message pattern once FreeBSD 11's execve would start
loading the image (freebsd-src 8c639945, sys/kern/kern_exec.c
exec_copyin_args, do_execve, exec_check_permissions; lib/libc/gen/exec.c
execv passes environ). Before that they fail as FreeBSD does: EFAULT for a
null argument vector or path, ENOENT and ENOTDIR from the lookup as stat
reports it, EACCES for a path that is not a regular file. Paths of
PATH_MAX bytes or more and strings over ARG_MAX throw instead of guessing
the console's limits. The execv calls in XPSemu's sources run in a fork
child (net/tap.c), and its fork fails with ENOSYS (ZiZc3/XPSemu 8eec07b4,
ps5/compat/libc_missing.c, ps5/build-title.sh --defsym).

NIDs computed with tools/nid_names.py and confirmed in aerolib.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 57f0fa3)
(cherry picked from commit 4f1ae1c)
The rename to execve dropped execv, which PPSA97358 imports.

Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit cdf4b17)
PS5MC (PPSA99420, Kodi 22) imports clock_settime (d7nUj1LOdDU) from
libkernel.prx, one reference, after sigwaitinfo in its import order.
Predicted stop once the imports ahead of it are covered (not a run):

  FAIL: unresolved ELF import d7nUj1LOdDU from libkernel.prx

The NID is computed with tools/nid_names.py and matches aerolib.

Follows FreeBSD 11.4 sys/kern/kern_time.c sys_clock_settime and
kern_clock_settime (8c639945a44588f6cfdddfb057bb5aad88735da0) for a
root caller: EFAULT for a null time (copyin), EINVAL for any clock but
CLOCK_REALTIME and for a negative tv_sec or a tv_nsec outside 0 to
999999999. A valid CLOCK_REALTIME request throws with the requested
time named, since the host clock must not be set and no guest clock
offset is kept.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Co-authored-by: David <david@example.com>
(cherry picked from commit ae9978a)
PPSA99058 and PPSA99420 import sceKernelGetCpuTemperature and sceKernelGetSocSensorTemperature and stop at start-up on main. Read the host CPU/package, board and NVMe sensors (hwmon/thermal on Linux, the ACPI thermal zones and the storage temperature property on Windows) and report an unsupported sensor with EINVAL.

(cherry picked from commit 0f73f5f)
sceCoredumpAttachUserFile (5nc2gdLNsok) and
sceCoredumpAttachMemoryRegionAsUserFile (MEJ7tc7ThwM) get the
signatures of Orbital's db_types.json (cc408367) and SharpProspero's
KernelSystem.cs (5dfdb4b0): (uint32_t userValue, const char* path) and
(uint32_t userValue, const void* mem, size_t size, const char* name).

The handler is never invoked here, so both return
SCE_COREDUMP_ERROR_NOT_IN_COREDUMP_HANDLER (0x81180003, shadPS4
coredump_error.h e0a46675) and attach nothing; a null path or name and
a null, empty or wrapping region throw because the order of the
console's checks is unknown.

Carried from @screamm with author attribution preserved.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

(cherry picked from commit 204355c)
…and chroot

Hand-merged from upstream: ec0d61e 55ddffe 2a8e745 9ceb6d1 dc0d316
41b0ca5 e3c1d01 603d94a 7e5bec0 f8a269e. The fork's libkernel_sys
Export.cpp and its test were an older shape of the file, so the upstream
versions were taken whole, together with the RenameGuestPath export in libc
Rename.cpp/General.hpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the guest ABI

Every other export of the C++ runtime is declared APS5_VABI, but these two
were not. On Windows a title calls them with the System V convention while
they read the Microsoft one, so __dynamic_cast took its fourth argument, the
src2dst hint, as the source pointer: an ordinary downcast (hint 0) returned
null, and the negative hints made it read through an invalid pointer.

guest_dynamic_cast calls both through APS5_VABI declarations, as a title
does, and checks a single-inheritance downcast, a failed cross cast, a cast
of a base object and the header __cxa_init_primary_exception fills in.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit f4be036)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 7154138)
Adapted from upstream b1cf014 (POSIX and Windows localtime failure paths;
the Windows year-range handling and its test are not ported).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PPSA99611 imports ceilf, floorf, truncf, isnan and isinf from libc.prx and stops at start-up on main. Implement them next to the existing double forms: the rounding results delegate to the standard library like the other float exports, and isnan/isinf reuse the __isnan/__isinf helpers isnanf already uses.

(cherry picked from commit 00f0589)
…ation on macOS

Cast away const on the category vtable entries (Apple clang rejects the
reinterpret_cast), register guest_dynamic_cast once, use duration_cast for the
_Cnd_timedwait deadline (libc++ system_clock is microsecond based), include
unistd.h for the libkernel_sys at-calls, and stub GuestThreadStackHostRangeOverlaps
in the direct memory test harness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
libSceFont and libSceNpEntitlementAccess located the executable
through /proc/self/exe, which macOS does not have, so finding the
system fonts and the entitlements file threw there. Use
_NSGetExecutablePath and resolve the path with
std::filesystem::canonical on macOS. Linux and Windows are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f30f3e8)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RINNECODER RINNECODER added the upstream-sync Upstream boykopovar/AnyPS5 intake label Oct 13, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T19:18:30.059375Z 0191e73 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 120267e2-4715-494b-bca0-d4640397668c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0191e73a20

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +485 to +486
auto native = std::filesystem::path(reinterpret_cast<const char8_t*>(base)) /
std::filesystem::path(reinterpret_cast<const char8_t*>(path));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep fd-relative paths inside the guest root

When a guest supplies a relative path containing enough .. components, this direct host-path concatenation lets host filesystem resolution escape the emulated root; for an aliased mount such as savedata, even one .. can reach the backing directory's siblings. The same construction is used by the new openat, readlinkat, fchmodat, unlinkat, and renameat paths, so a title can read, create, rename, chmod, or delete host files outside its guest filesystem. Resolve or clamp these fd-relative paths using the guest path rules rather than passing base / path directly to host APIs.

Useful? React with 👍 / 👎.

# Conflicts:
#	core/libs/prx/libc/src/Math.cpp
@RINNECODER
RINNECODER merged commit a6c57a0 into main Oct 13, 2026
5 checks passed
@RINNECODER
RINNECODER deleted the sync8/core-libs branch October 13, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.