Commit Graph
8 Commits
Author SHA1 Message Date
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
mugurc c27787a7db fix(libc): build the host-facing libc code on macOS
feof_unlocked, ferror_unlocked, getc_unlocked and putc_unlocked are macros
on macOS, so they are called without the global scope qualifier. The
remaining differences are the ones Darwin's headers and libSystem have:

- CLOCK_REALTIME_COARSE and st_mtim do not exist; the write mark uses
  CLOCK_REALTIME and st_mtimespec.
- tm_zone is a non-const char*.
- __cxa_thread_atexit returns void, so the wrapper reports success.
- Darwin's stack protector reads __stack_chk_guard from libSystem; the
  guard of the guest libc has the postfixed name, which receives the NID
  of the original.
- APS5_EXPORT spells the symbols with the leading underscore of Mach-O.
- GuestArenaSetProtection and PosixProtection are built on macOS as on Linux.
- The fclose failure test fills /dev/full, which exists on Linux only.

exception_runtime relies on the Itanium unwinder of libc, which is not
registered on macOS (the host libc++abi is used), so its test is only
registered elsewhere.
2026-10-22 12:25:14 +03:00
Ondra97 3f95553e80 fix(libc): ignore noreplace for read-only streams 2026-10-16 11:35:14 +02:00
Dean 57dc136026 Merge pull request #3936 from MarcZX100/codex/carry-fopen-s-output-null
fix(libc): clear fopen_s output on invalid arguments
2026-10-13 02:32:30 +13:00
MarcZX100 cc7343daf5 fix(libc): clear fopen_s output on invalid arguments
(cherry picked from commit 387279ee94)
2026-10-11 19:16:51 +00:00
MarcZX100 fdf288f3fc fix(libc): return fclose failures to callers
(cherry picked from commit 610d6cdda0)
2026-10-11 19:12:46 +00:00
Adrià FranchandClaude 7389b2581f feat(libc): implement std::_Fiopen
Co-Authored-By: Claude <[email protected]>
2026-10-06 15:09:04 +02:00
Akhil MoolaandClaude Sonnet 5.5 be6705e977 feat(libc): export std::_Fiopen as unimplemented
PPSA21564 and PPSA21567 import std::_Fiopen (NID vYWK2Pz8vGE), the only libc
NID the host libc lacks. Without it the executable fails to load against
the host libc when the title's own libc.prx is left out of the guest
conversion, which is how the Linux runs of PPSA21564 avoid the libc.prx
binding crash. The values of the open mode and the meaning of the
protection argument are unknown, so the export throws when called; it was
never called in a 300 s run of PPSA21567.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014A3UgWDUxE1EeHyVZm6tiN
2026-10-05 20:06:18 -06:00