Commit Graph
148 Commits
Author SHA1 Message Date
xxLnolan 30454880de fix(libc): implement PAF mspace memalign 2026-10-19 13:59:05 +02:00
Dean 6762694735 Merge pull request #7761 from angleboyndn-stack/fix/libc-secure-string-destination-limits
fix(libc): reject oversized secure string destinations
2026-10-20 00:52:00 +13:00
Dean f72c7aacfa Merge pull request #7506 from cadenasynyster/fix/libc-throw-bad-variant-access
feat(libc): implement std::__throw_bad_variant_access
2026-10-19 23:54:48 +13:00
Adrià 3050105f24 Merge pull request #6707 from karimibrahim07/feat/libc-qsort-s
feat(libc): implement qsort_s
2026-10-19 11:47:03 +02:00
Adrià 959cfdd1c5 Merge pull request #6686 from DavidSamir/fix/libc-mktime-before-1900-macos
fix(libc): convert mktime before 1900 from the zone's own offsets on macOS
2026-10-19 10:59:57 +02:00
Adrià 096279ed25 Merge pull request #6610 from JJenkx/fix/linux-sdk-heap-owner
fix(libc): share the guest SDK application allocator
2026-10-19 09:38:02 +02:00
ShinMalphur fed4344c72 docs(libc): record secure string size assumptions 2026-10-19 13:11:36 +06:30
Adrià dc54701e49 Merge pull request #6541 from wachi35676/fix/libc-fopen-random-device
fix(libc): read /dev/random and /dev/urandom through fopen
2026-10-19 08:38:06 +02:00
Adrià 9817d53cc9 Merge pull request #6345 from hypermoist/feat/libc-exact-math
feat(libc): add exact long double and BSD math exports
2026-10-19 08:06:40 +02:00
Adrià b4d517ed10 Merge pull request #6334 from hypermoist/feat/libc-dinkumware-atomics
feat(libc): implement the remaining Dinkumware _Atomic helpers
2026-10-19 04:03:52 +02:00
Adrià d5c854dd9b Merge pull request #6339 from hypermoist/feat/libc-std-vector-algorithms
feat(libc): implement the __std vectorized algorithm helpers
2026-10-19 02:40:50 +02:00
Adrià 0f121739ce Merge pull request #6331 from hypermoist/feat/libc-generic-atomics
feat(libc): implement the 16-byte __sync builtins and __atomic_is_lock_free
2026-10-19 01:37:09 +02:00
Adrià 50bb0b95cf Merge pull request #6330 from hypermoist/feat/libc-float-builtins
feat(libc): implement the compiler-rt floating-point builtins
2026-10-19 01:24:52 +02:00
Adrià 8e7904b201 Merge pull request #6322 from hypermoist/feat/libc-integer-builtins
feat(libc): implement the compiler-rt integer builtins
2026-10-19 01:15:26 +02:00
hypermistandClaude Opus 5.5 ec3fe412db feat(libc): implement the remaining Dinkumware _Atomic helpers
The 1-, 2- and 8-byte loads, stores, exchanges, compare-exchanges and fetch
operations, _Atomic_is_lock_free_N, the flag and fence functions and the
lock-based generic _Atomic_copy, _Atomic_exchange and _Atomic_compare_exchange_*,
matching the libc.prx bundled with PPSA08427 including its handling of
invalid memory orders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu
2026-10-19 01:09:51 +02:00
Muhammad Wasif Ali WasifandClaude Opus 5.5 b4e80e8fc7 fix(libc): read /dev/random and /dev/urandom through fopen
fopen resolved the random device paths to a host file that does not
exist and failed with ENOENT, while open and sceKernelOpen already serve
them from host entropy. A read-only fopen of either path now returns a
stream whose fread fills the buffer with host entropy. setvbuf, feof,
ferror, clearerr, the stream locks and fclose work on it, fflush returns
0 as on a FreeBSD stream that is not writing, other stream functions
throw, and opening the paths for writing throws as in libkernel.

ProsperoTV (PPSA99003) reads its phone pairing code this way and showed
"Code expired or unavailable".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 03:01:38 +05:00
hypermistandClaude Opus 5.5 e9f4dbfcf5 fix(libc): check the C11 runtime constraints in snprintf_s and vsnprintf_s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 23:43:55 +02:00
Adrià c7f67e5cf3 Merge pull request #6144 from freshstart2066-create/feat/libc-safe-wide-strings
feat(libc): implement safe wide string and concatenation functions
2026-10-18 23:26:38 +02:00
Adrià 48d61f53b4 Merge pull request #6217 from milescoviello/fix/libc-malloc-stats-default-heap
feat(libc): answer malloc_stats_fast for the default heap
2026-10-18 21:31:59 +02:00
Dean 3dda12d1d3 Merge pull request #7562 from slick-daddy/fix/libc-pointer-formatting-7549
fix(libc): format %p the way the console's libc does
2026-10-19 07:24:48 +13:00
Adrià 3aebaa7de6 Merge pull request #6124 from yripper/feat/macos-guest-arena
feat(libc): reserve the guest arena on macOS
2026-10-18 19:09:43 +02:00
Adrià e1dae23e01 Merge pull request #6107 from YossiYad/fix/libc-closed-standard-descriptors
fix(libc): open closed standard descriptors on /dev/null when libc loads
2026-10-18 18:58:19 +02:00
Adrià 81cb863394 Merge pull request #6061 from wachi35676/fix/libc-drive-component-under-mount
fix(libc): keep a drive-letter component of a guest path under its mount on Windows
2026-10-18 17:51:46 +02:00
Slick Daddy 536fef3228 fix(libc): format %p the way the console's libc does
The console's libSceLibcInternal.sprx (measured on firmware 12.70 in
#7549) prints %p as bare lowercase hex without a 0x prefix, prints 0 for
a null pointer, ignores #, + and the space flag, counts only the digits
towards the width, pads with spaces on the left (on the right for - and
with zeros for 0 when there is no precision), treats the precision as
the minimum number of digits, prints nothing for a null pointer under
%.0p, and accepts the l length. FormatPointer instead followed FreeBSD
and printed 0x..., which is what a title does not see on hardware.

FormatPointer now prints the digits alone, the narrow Windows formatter
accepts %lp, and Linux routes %p and %lp to the guest formatter instead
of glibc, which prints the FreeBSD form and (nil) for a null pointer.
The wide family still refuses %lp, because the console's swprintf was
not measured with it; it returns -1 as it does for any other conversion
the formatter rejects. The debt note records the pointer cases the
console was not measured with and what the Linux routing means for a
format that mixes %p with a refused conversion.
2026-10-18 16:59:34 +03:00
cadenasynysterandClaude Opus 5.5 9f3e867eec feat(libc): implement std::__throw_bad_variant_access
Onimusha: Way of the Sword (PPSA27836 01.000.001) imports
_ZSt26__throw_bad_variant_accessv (9G6z-nF6njg) from libc, and its
bundled libc.prx does not export it, so the title fails to load with
an unresolved import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GtXavMkgCTCdmRpweviHcQ
2026-10-18 11:41:56 +02:00
Dean d9656f1283 Merge pull request #7353 from T3cm0/bionic/mergesort
feat(libc): implement mergesort
2026-10-18 16:22:12 +13:00
Dean 3ef424a7f6 Merge pull request #7348 from T3cm0/bionic/paf-mspace
feat(libc): implement the sceLibcPafMspace allocation exports
2026-10-18 15:52:13 +13:00
Dean b39d90bf14 Merge pull request #7357 from T3cm0/bionic/seed48-lcong48
feat(libc): implement seed48 and lcong48
2026-10-18 15:20:36 +13:00
Dean 5cc435f02f Merge pull request #7355 from T3cm0/bionic/uchar-conversions
feat(libc): implement the uchar.h conversions, mblen and wctomb
2026-10-18 15:20:29 +13:00
T3cm0andClaude Opus 5.5 26898755e5 feat(libc): implement seed48 and lcong48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 20:44:32 -05:00
T3cm0andClaude Opus 5.5 58697488a2 feat(libc): implement the uchar.h conversions, mblen and wctomb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 20:43:39 -05:00
T3cm0andClaude Opus 5.5 24a999c499 feat(libc): implement long double, Bessel and integer math exports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 20:43:13 -05:00
T3cm0andClaude Opus 5.5 8283831a19 feat(libc): implement mergesort
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 20:42:46 -05:00
T3cm0andClaude Opus 5.5 66247cef5c feat(libc): implement the sceLibcPafMspace allocation exports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 20:40:58 -05:00
Dean eeea684a0b Merge pull request #7280 from T3cm0/bionic/mspace-reallocalign-order
fix(libc): take sceLibcMspaceReallocalign's alignment before its size
2026-10-18 13:26:35 +13:00
Dean 6eea4e0c2e Merge pull request #7282 from T3cm0/bionic/unlocked-stream-queries
feat(libc): implement clearerr_unlocked, fileno_unlocked and fgetln
2026-10-18 13:26:31 +13:00
JJenkx bbc16577c9 fix(libc): share the guest SDK application allocator 2026-10-17 20:19:08 -04:00
Dean 8532632d4e Merge pull request #7249 from Lorkydey/feat/libc-binary-word-io
feat(libc): implement getw and putw
2026-10-18 10:18:50 +13:00
T3cm0andClaude Opus 5.5 22c584acd3 feat(libc): implement clearerr_unlocked, fileno_unlocked and fgetln
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 16:17:27 -05:00
T3cm0andClaude Opus 5.5 3802f887f2 fix(libc): take sceLibcMspaceReallocalign's alignment before its size
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 16:17:22 -05:00
Dean cf217c51c6 Merge pull request #7211 from simonbronk/codex/secure-scan-null-20261017
fix(libc): reject null secure scan destinations
2026-10-18 10:16:38 +13:00
milescovielloandClaude Opus 5.5 dde480e6c8 feat(libc): answer malloc_stats_fast for the default heap
Ship of Harkinian (PPSA99320) logs its heap use with malloc_stats_fast
every 10 s and stopped on the first call, since only an application
allocator could answer it. The default heap now keeps its system and
in-use byte counts with their peaks and fills the same managed-size
block as sceLibcMspaceMallocStatsFast, whose layout moves to a shared
header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 20:43:32 +00:00
Dean 0f0d4004a4 Merge pull request #6517 from Wild-Badger/fix/libc-wide-collate-layout
fix(libc): count wide collate string elements
2026-10-18 09:41:21 +13:00
lorkydey 7c07ebd095 feat(libc): implement getw and putw 2026-10-17 21:28:18 +02:00
Adrià 5859889b29 Merge pull request #6133 from AkulTyagi11/feat/libc-modti3
feat(libc): implement __modti3
2026-10-17 21:06:42 +02:00
simonbronk f0d68fb436 fix(libc): reject null secure scan destinations
Prevent reached null conversion destinations from crashing sscanf_s and vsscanf_s. Return EOF before writes and retain earlier assignments. Add regression coverage through both guest ABI entry points.

AI-assisted: yes (OpenAI Codex). Windows WinLibs GCC 15.2 Release: production baseline crashes with the new regression; fixed shared libc passes guest_scan_count, guest_formatting, guest_wide_formatting and guest_strings (4/4). Conventions pass. Full all-target build was deliberately stopped after 83s with 3691 pending targets, not completed. No title or console run; constraint-handler invocation remains unimplemented as documented. No performance or coverage-percentage claim.
2026-10-17 18:46:36 +02:00
Muhammad Wasif Ali WasifandClaude Opus 5.5 78cabf5dcd fix(libc): keep a drive-letter component of a guest path under its mount on Windows
A guest path is resolved by appending its components to the host root or
to a mount alias directory through std::filesystem::path. On Windows a
component such as "C:" that came first in the appended part was parsed as
a root name, so operator/ replaced the host directory instead of
appending: "/savedata0/C:/Windows/win.ini" and "/app0/../C:/Windows/win.ini"
resolved to "C:\Windows\win.ini", and "/C:/x" lost the component and
resolved to "<root>\x". A colon is an ordinary character in a FreeBSD
file name, so those names belong under the mount.

Guest paths are now split into component names and joined to the host
directory as text. Explicit native drive paths are still passed through.
On NTFS a name containing ":" still opens an alternate data stream; the
libc debt list now records it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 21:22:08 +05:00
Dean 66702f1cff Merge pull request #7060 from Aryansh1520/fix/libc-backtrace-self-linux
feat(libc): implement sceLibcBacktraceSelf and GetBufferSize on Linux
2026-10-18 04:49:45 +13:00
Dean 7b763e6359 Merge pull request #7068 from AlexOfTheForest/fix/fopen-errno
fix(libc): translate host errno from fopen, freopen and fopen_s
2026-10-18 04:49:08 +13:00
Dean 05b235498a Merge pull request #7099 from Lorkydey/feat/libc-safe-error-messages
feat(libc): implement bounded error message APIs
2026-10-18 01:58:23 +13:00