Commit Graph
1359 Commits
Author SHA1 Message Date
Adrià baabfbc204 Merge pull request #9474 from Gruzzberry/fix/access-symbolic-link
fix(libc): follow a Windows symbolic link in access
2026-10-25 19:14:11 +01:00
Adrià 19fe176ddc Merge pull request #9456 from mazen320/feat/libc-time-get-vtable
feat(libc): export the time_get facet vtable as data
2026-10-25 18:38:52 +01:00
Dean 4718dedcf8 Merge pull request #10605 from harisibrar1/fix/rtti-ambiguous-private-base
fix(libc): reject a catch or upcast to a base that a private path repeats
2026-10-26 05:59:40 +13:00
Adrià 7b7d445bfb Merge pull request #9439 from milescoviello/feat/trace-calls-file
feat(libc): write the called imports to APS5_TRACE_CALLS_FILE every 10 seconds
2026-10-25 17:42:50 +01:00
Adrià c661d9fae2 Merge pull request #9133 from fogydes/feat/libSceLibcInternal-posix-spawn
feat(libSceLibcInternal): implement posix_spawn process creation and reaping
2026-10-25 17:38:41 +01:00
Adrià 0a77bbf18c Merge pull request #9170 from rooklz/fix/libc-thrd-id
fix(libc): return the calling thread from _Thrd_id as the console's libc.prx does
2026-10-25 17:34:31 +01:00
Dean 5e675163f0 Merge pull request #9916 from JJenkx/windows/printf-decimal-console
fix(libc): round and cap %e, %f and %g as titles' libc.prx does
2026-10-26 04:45:09 +13:00
Dean 15e1e72a21 Merge pull request #10542 from anizayazcodpro-png/feat/libc-iswascii
feat(libc): implement iswascii
2026-10-26 04:19:25 +13:00
Maz 4e657b158e feat(libc): export the time_get facet vtable as data
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.
2026-10-25 15:20:04 +01:00
fogydes bde7cc210a fix(libkernel): report ECHILD to a Windows waiter another thread reaps first 2026-10-25 13:57:18 +01:00
fogydes 0514307ab8 fix(libkernel): translate waitpid child statuses to the guest numbering 2026-10-25 13:57:18 +01:00
fogydes 723d932f73 feat(libSceLibcInternal): implement posix_spawn process creation and reaping 2026-10-25 13:57:17 +01:00
Dean cdcbd55134 Merge pull request #10787 from 00xDisaster/feat/libc-dinkumware-divide
feat(libc): implement _Divide, _FDivide, _Recip and _FRecip
2026-10-26 00:36:31 +13:00
Adrià 35d22d88f9 Merge pull request #9618 from xXPBSXx/fix/output-structs-efault
fix(libkernel): fail the stat family with EFAULT when the output struct is not writable guest memory
2026-10-25 11:52:20 +01:00
Dean 63a863d3b0 Merge pull request #10314 from JJenkx/windows/libc-log1p-msun
fix(libc): compute log1p with FreeBSD msun's algorithm, as titles' libc.prx does
2026-10-25 23:09:45 +13:00
anizayazcodpro-png fb99d0bf8c feat(libc): implement iswascii
Implement iswascii in libc, checking whether a wide character falls within the 7-bit ASCII range (0x00 to 0x7F). Add unit test coverage in GuestRuneLocale.
2026-10-25 15:34:22 +05:30
Adrià 16025845e5 Merge pull request #9423 from AliZedan1A/fix/guest-path-efault
fix(kernel): safely copy guest path arguments
2026-10-25 10:48:00 +01:00
Dean 7271c4500f Merge pull request #10815 from MarcZX10/marc/fix-heap-error-report-closed-stdout
fix(libc): let sceLibcInternalHeapErrorReportForGame skip a closed standard output
2026-10-25 22:39:37 +13:00
Dean d6da8da587 Merge pull request #10765 from 00xDisaster/feat/libc-ldinkumware
feat(libc): implement long-double Dinkumware helpers
2026-10-25 21:50:29 +13:00
MarcZX10 6f78759a6e fix(libc): let sceLibcInternalHeapErrorReportForGame skip a closed standard output
The heap error report threw FileStream: closed stream out of the export when the guest had closed its standard output, so a heap-error diagnostic aborted through the exception instead of reporting. The standard output part is now skipped when the stream is closed; the host diagnostic on the host stderr is still written.
2026-10-25 07:55:22 +00:00
ali zedan 2c5fcf6406 fix(kernel): safely copy guest path arguments 2026-10-25 08:28:09 +01:00
JJenkxandClaude Opus 5.5 185098a39d fix(libc): compute log1p with FreeBSD msun's algorithm, as titles' libc.prx does
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]>
2026-10-25 02:56:59 -04:00
MarcZX10 1cf6734bf9 fix(libc): fail wprintf on a closed standard output with EBADF
printf, puts and vwprintf already return -1 with errno 9 once a failed freopen
closed stdout. wprintf reported EINVAL.
2026-10-25 06:30:05 +00:00
MarcZX10 de8cd096b2 fix(libc): fail fputwc and fputws on a closed stream with EBADF
The write threw inside GetNativeStream, which the wide writers catch and
report as EINVAL. fputc, fputs and vfwprintf fail a closed stream with
errno 9; putwc and putwchar go through fputwc.
2026-10-25 06:30:05 +00:00
MarcZX10 0f9fff2048 fix(libc): fail ungetwc on a closed stream with EBADF
ungetwc on a stream that a failed freopen closed reached GetHandle() and threw
out of the export. ungetc and the other narrow stream calls return failure
with errno 9.
2026-10-25 06:30:05 +00:00
Dean e7e3e9c198 Merge pull request #9844 from JJenkx/windows/libc-exp2f-msun
fix(libc): compute exp2f with FreeBSD msun's algorithm, as titles' libc.prx does
2026-10-25 16:36:34 +13:00
Dean 5482ec23aa Merge pull request #9163 from MaxLikesCode/fix/libc-compare-byte-difference
fix(libc): return the byte difference from strcmp, strncmp and memcmp
2026-10-25 15:27:53 +13:00
Disaster 72583a0b20 feat(libc): implement _Divide, _FDivide, _Recip and _FRecip 2026-10-25 04:20:44 +03:00
Dean f4aabbb122 Merge pull request #10129 from orezraey/fix/libc-strftime-measured-ps5
fix(libc): format strftime and asctime fields as measured on a PS5
2026-10-25 14:02:08 +13:00
Rookie 0297073da2 fix(libc): return the calling thread from _Thrd_id as the console's libc.prx does 2026-10-25 01:45:47 +01:00
milescovielloandClaude Opus 5.5 a938dd8f20 feat(libc): write the called imports to APS5_TRACE_CALLS_FILE every 10 seconds
A traced run that ends without a crash or an abort never reports which
imports it called. With APS5_TRACE_CALLS_FILE set, the first traced import
starts a thread that rewrites that file every 10 seconds with every import
called so far, most called first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 00:15:39 +00:00
Dean Galvin 5bf26ec0cd Merge main into fix/libc-compare-byte-difference 2026-10-25 12:54:55 +13:00
Disaster 10c2a645a3 feat(libc): implement long-double Dinkumware helpers
Implement _LLog, _LDivide and _LRecip for the PS5 libc surface, with guest coverage for base dispatch, division and reciprocal semantics.
2026-10-25 02:41:03 +03:00
orezraeyandClaude Opus 5.5 6b1962e978 Merge main into fix/libc-strftime-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 20:28:55 -03:00
dantdmdarealguy 4c2f9e3df7 fix(libc): switch update streams to reading in vfscanf
vfscanf, which vscanf and scanf also go through, read without switching
the stream to reading first. On Windows a vfscanf directly after fwrite
on an r+ stream returned bytes of the write buffer, as fscanf did before
a7e6e597d. It now calls SwitchToReading as fscanf does.
2026-10-24 18:28:28 -05:00
xXPBSXxandClaude Sonnet 5.5 c424bd17c8 fix(libc): never fall back to an unchecked copy-out on non-EFAULT host errors
GuestCopyOut_nid_no_patch fell back to memcpy when process_vm_writev failed
with anything but EFAULT, and on every non-Linux/non-Windows host. Throw
instead (macOS uses mach_vm_write as Udp.cpp does) and cover read-only and
PROT_NONE pages plus a seccomp EPERM child in guest_fstat_fault.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 01:10:37 +02:00
Dean Galvin 83b63bfbb5 Merge main into windows/libc-exp2f-msun 2026-10-25 12:09:10 +13:00
xXPBSXxandClaude Sonnet 5.5 83f28bd67f fix(libkernel): fail the stat family with EFAULT when the output struct is not writable guest memory
fstat, _fstat, sceKernelFstat, stat, lstat, sceKernelStat and _fstatfs
filled the caller's struct in place, or copied into it after a check that
only tests for null, so a pointer into unmapped memory crashed the host.
Fill a local struct and copy it out with a checked write that fails with
EFAULT. FreeBSD 11.4 does the same after the lookup has succeeded:
copyout(&ub, uap->sb) in sys_fstat (sys/kern/kern_descrip.c:1328),
copyout(&sb, uap->ub) in sys_stat (sys/kern/vfs_syscalls.c:2066) and
copyout(sfp, uap->buf) in sys_fstatfs (sys/kern/vfs_syscalls.c:337).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 01:08:01 +02:00
boykopovar 2db4bb590b fix(sdk): restore linux and libc++ header compatibility 2026-10-25 00:02:51 +03:00
boykopovar fdf9ca7574 fix(sdk): reconcile public headers after rebase 2026-10-24 23:17:47 +03:00
boykopovar d355dec4fc test(sdk): validate vabi function header declarations 2026-10-24 23:17:46 +03:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
JJenkxandClaude Opus 5.5 182bd6aa78 fix(libc): round and cap %e, %f and %g as titles' libc.prx does
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]>
2026-10-24 16:17:13 -04:00
JJenkxandClaude Opus 5.5 00fa026aae fix(libc): send %a to the guest formatter on Linux too
Linux handed a format without wide arguments, %m or %p to glibc, so %a
there still printed subnormals unnormalised and rounded hexadecimal
digits half to even, and CheckHexFloat, which runs on every host,
failed on Linux. Route %a and %A to FormatWindows on Linux as well.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 16:14:41 -04:00
Dean 0ea0f25e1b Merge pull request #8863 from UnhealthyKraken/feat/libc-feholdexcept
feat(libc): implement feholdexcept
2026-10-25 07:37:11 +13:00
Dean 82443ce914 Merge pull request #10223 from orezraey/fix/libc-printf-measured-ps5
fix(libc): format sizes, NaN signs, UTF-16 units, positions and unknown conversions as a PS5 does
2026-10-25 07:34:56 +13:00
Dean aad10c84cc Merge pull request #9979 from mazen320/feat/libc-collate-vtable
feat(libc): export the collate facet vtable as data
2026-10-25 07:34:33 +13:00
Adrià 6b23aaf129 Merge pull request #9159 from EagleBearerYS/fix/agc-rewatched-imports-compared-when-shared
fix(agc): keep a rewatched import's memory compared once it is shared
2026-10-24 20:26:38 +02:00
Maz 2f94984276 feat(libc): export the collate facet vtable as data
Titles that resolve collate<char>'s vtable as an object need a 72-byte export matching console libc.prx (PPSA16833).
2026-10-24 21:49:15 +04:00
Dean 845e081537 Merge pull request #9038 from akkadbakkad89/feat/libc-facet-getcat
feat(libc): cover the codecvt, numpunct, num_put and time_put facets, their ids and std::clog
2026-10-25 06:39:27 +13:00