Commit Graph
681 Commits
Author SHA1 Message Date
Adrià e87f2d9394 Merge pull request #12162 from AlexFigas/feat/libc-aligned-array-operators
feat(libc): export the remaining aligned and array operator new and delete overloads
2026-10-29 14:39:44 +01:00
Adrià 157b02c4f1 Merge pull request #11852 from ionut27001/fix/wf-scanf-q-length-linux
fix(libc): end sscanf and vsscanf at a q length on Linux and macOS
2026-10-29 13:57:18 +01:00
Adrià df53927b7b Merge pull request #10929 from Aspct3434/claude/modest-curie-705h76
fix(libc): read characters outside the BMP as surrogate pairs in fgetwc
2026-10-29 13:49:54 +01:00
Adrià aab650b4d3 Merge pull request #11893 from JJenkx/windows/libc-printf-ignored-lengths
fix(libc): ignore printf length modifiers that do not apply, as titles' libc.prx does
2026-10-29 13:49:01 +01:00
Adrià 7b57271358 Merge pull request #11504 from verusferro/feat/libc-xfilesystem-error
feat(libc): throw std::filesystem::filesystem_error from _Xfilesystem_error as the console's libc does
2026-10-29 13:47:45 +01:00
Adrià f99d7fece3 Merge pull request #12054 from Aspct3434/claude/libc-environment-strings-stay-alive
fix(libc): keep guest environment strings alive across setenv and uns…
2026-10-29 11:08:38 +01:00
Adrià 9365465457 Merge pull request #12186 from Gonic0/fix/libc-getifaddrs-af-link-macos
fix(libc): list getifaddrs AF_LINK entries on macOS hosts
2026-10-29 07:44:43 +01:00
Dean 711c4eca09 Merge pull request #11785 from ionut27001/fix/libc-hardware-concurrency
fix(libc): return the CPU count of the default thread mask from std::thread::hardware_concurrency
2026-10-29 12:16:46 +13:00
Dean 3e3fa79116 Merge pull request #12229 from Danigamer05/feat/libc-stdc-one-runs
feat(libc): add C23 leading and trailing one counts
2026-10-29 12:10:46 +13:00
Dean 34ae0d5e9e Merge pull request #12193 from Danigamer05/feat/libc-stdc-zero-runs
feat(libc): add C23 leading and trailing zero counts
2026-10-29 12:09:21 +13:00
Dean b76d41ea82 Merge pull request #11979 from xXPBSXx/carry/6713-default-heap-no-procparam
fix(libc): use the default heap for an executable without process parameters
2026-10-29 11:49:55 +13:00
Dean 91f495595f Merge pull request #12289 from fogydes/fix/bsearch-s-zero-size
fix(libc): invoke constraint handler on zero element size in bsearch_s
2026-10-29 11:47:28 +13:00
Dean 1f52200308 Merge pull request #11333 from Danigamer05/feat/libc-signed-max32
feat(libc): implement signed 32-bit maximum value helper
2026-10-29 07:27:25 +13:00
Dean 45f40b505d Merge pull request #12291 from B-Howell/claude/fix-issue-9691-hex-strtod-erange
fix(libc): match title libc.prx for hexadecimal strtod underflow
2026-10-29 07:26:33 +13:00
Adrià 7fea87746b Merge pull request #11737 from xXPBSXx/libm/asinh-msun
fix(libc): compute asinh with FreeBSD msun's algorithm
2026-10-28 17:58:59 +01:00
Adrià 8c621aa276 Merge pull request #11729 from iAbdulrrahman/feat/libc-fetch-64-bit-atomics
feat(libc): implement 64-bit atomic fetch helpers
2026-10-28 17:35:48 +01:00
Dean 3070a25d9e Merge pull request #12319 from JJenkx/windows/libc-acosf-edom
fix(libc): store EDOM and raise FE_INVALID from acosf and asinf domain errors
2026-10-29 03:34:51 +13:00
Adrià 31646b6e17 Merge pull request #12259 from B-Howell/docs/libc-rename-source-lookup-debt
docs(libc): drop the rename dot-destination gap that 308848e1a6 closed
2026-10-28 14:47:59 +01:00
Claude 84aec8b0ac fix(libc): read characters outside the BMP as surrogate pairs in fgetwc
fputws and wprintf write a UTF-16 surrogate pair as one four-byte
UTF-8 sequence, but fgetwc decoded that sequence into a single code
point above 0xFFFF, which is not a 16-bit guest wchar_t value, and
fgetws stored it truncated: fputws(u"A\U0001F600\n") read back as
A, U+F600, newline.

fgetwc now returns the high surrogate and keeps the low one in the
stream for the next read, so fgetws stores the pair, also when the
buffer fills between the two halves. A successful seek discards it,
as FreeBSD's fseeko resets the stream's mbstate. Sequences that
decode to an overlong form or above U+10FFFF, and lead bytes F8 to
FF, fail with EILSEQ instead of returning made-up characters; the
three-byte surrogates that fputwc writes for a single unit are still
read back as that unit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QegaHM5QeCynUQ2ZLWHE4b
2026-10-28 14:43:48 +01:00
verusferro 778c4a74ec feat(libc): throw std::filesystem::filesystem_error from _Xfilesystem_error as the console's libc does 2026-10-28 15:10:30 +03:00
Alexandre Figueiredo 2b21d42b76 feat(libc): export the remaining aligned and array operator new and delete overloads 2026-10-28 11:50:06 +00:00
Dean 14a269cfef Merge pull request #12187 from Danigamer05/feat/libc-stdc-count-zeros
feat(libc): add C23 count-zeros exports
2026-10-28 22:50:41 +13:00
Dean f653b562a9 Merge pull request #12037 from JJenkx/windows/libc-fexp-titles
fix(libc): compute _Exp and _FExp as titles do
2026-10-28 22:40:19 +13:00
B-HowellandClaude Opus 5.5 a252638976 docs(libc): cite the strtod measurement by title ID in the debt entries
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 05:24:35 -04:00
JJenkxandClaude Opus 5.5 8b5c02ca61 fix(libc): store EDOM and raise FE_INVALID from acosf and asinf domain errors
For |x| > 1, the infinities and NaN, titles' libc.prx stores EDOM and
raises FE_INVALID from acosf, quiet NaN included, and asinf also
raises FE_INVALID for a quiet NaN. acosf returned the same NaN bits
without either, and asinf set errno but raised nothing for a quiet NaN.
Both now call _Feraise with the invalid exception, which stores EDOM
and raises the flag in both units; the results are unchanged.

The acosf test asserted the old errno-preserving behaviour from a
FreeBSD reading; it now checks the titles' EDOM and FE_INVALID.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 05:17:22 -04:00
fogydes 1af5f0735f fix(libc): invoke constraint handler on zero element size in bsearch_s 2026-10-28 13:31:49 +05:30
B-HowellandClaude Opus 5.5 82c8a51391 fix(libc): saturate the hexadecimal strtod exponent past any digit run
The explicit binary exponent stopped accumulating near 1e9 while the
digits add 4 per character without bound, so a subject with a few
hundred million digits was classified against the wrong exponent:
0x1 followed by 3e8 zeros and p-1200000005000 kept errno, and a long
zero fraction with p+1000000000000 underflowed instead of overflowing.
Saturate the explicit exponent at 2^62, beyond what any addressable
digit run can offset, so the sum never overflows or changes sign.

Record that _Stod and _Stodx follow the title libc.prx rule for
hexadecimal underflow, unverified for libSceLibcInternal.

Refs #9691

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:49:24 -04:00
B-HowellandClaude Opus 5.5 33c69417e4 docs(libc): trim the hexadecimal strtod debt entry to what is open
Keep only the gaps: the rule is measured on one title-bundled libc.prx,
and on Linux glibc 2.35's strtod rounds some hexadecimal subnormal
results a unit low.

Refs #9691

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:49:24 -04:00
B-HowellandClaude Opus 5.5 6084ed65b4 fix(libc): match title libc.prx for hexadecimal strtod underflow
Classify hexadecimal strtod and wcstod input from its own digits rather
than a long double approximation. As measured on God of War Ragnarok's
bundled libc.prx, ERANGE is set only on overflow or when the exact value
is below 2^-1074, and a value between 2^-1075 and 2^-1074 becomes the
smallest subnormal only from 2^-1075 * (1 + 2^-52) up.

Refs #9691

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:49:24 -04:00
Dean da6b0ea8dd Merge pull request #11884 from JJenkx/windows/libc-strtof-nan-payload
fix(libc): keep NaN payloads in strtof and wcstof as titles' libc.prx does
2026-10-28 20:11:27 +13:00
B-HowellandClaude Opus 5.5 dbea3c9c0c docs(libc): drop the rename dot-destination gap that 308848e1a6 closed
rename and sceKernelRename now look the source up before they reject a
dot destination, as FreeBSD 11.4's kern_renameat does, so a missing
source onto dir/. fails with ENOENT. guest_filesystem covers it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 01:46:12 -04:00
Dean 5ab8acf45f Merge pull request #11309 from Danigamer05/feat/libc-signed-min32
feat(libc): implement signed 32-bit minimum value helper
2026-10-28 17:50:21 +13:00
Dean c9cc3b34db Merge pull request #11304 from Danigamer05/feat/libc-unsigned-max32
feat(libc): implement unsigned 32-bit maximum
2026-10-28 17:50:05 +13:00
Dean 24795c0f56 Merge pull request #10529 from JJenkx/fix/libc-expm1-scaling-association
fix(libc): preserve expm1 rounding during exponent scaling
2026-10-28 17:49:49 +13:00
Dean dbbe99aeb0 Merge pull request #9772 from UnhealthyKraken/feat/libc-floating-prefix
feat(libc): implement floating-point prefix helpers
2026-10-28 17:49:14 +13:00
Adrià 0c5401dcbd Merge pull request #9735 from mazen320/feat/libc-ctype-vtable
feat(libc): export the ctype facet vtable as data
2026-10-28 05:36:29 +01:00
Danigamer05 d7986b1fb6 feat(libc): add C23 leading and trailing one counts 2026-10-28 04:54:42 +01:00
Adrià 439d03db38 Merge pull request #11663 from Danigamer05/feat/libc-stdc-count-ones
feat(libc): add C23 count-ones exports
2026-10-28 04:19:47 +01:00
Adrià f1f1737371 Merge pull request #11647 from B-Howell/codex/libc-strtoq
feat(libc): implement strtoq
2026-10-28 04:06:20 +01:00
Danigamer05 504111f10c feat(libc): add C23 leading and trailing zero counts 2026-10-28 03:54:03 +01:00
Danigamer05 e5835d6866 feat(libc): add C23 count-zeros exports 2026-10-28 03:09:35 +01:00
Nicolas GonzalezandClaude Opus 5.5 d702b9d7e5 fix(libc): map macOS interface types to FreeBSD's as on Linux
macOS numbers gif and stf 0x37 and 0x39, where FreeBSD uses 0xf0 and 0xd7, and
has types FreeBSD lacks such as IFT_CELLULAR. The macOS AF_LINK type now maps
like the Linux one: Ethernet, loopback and PPP keep their numbers and the
others report IFT_OTHER.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 23:02:57 -03:00
Nicolas GonzalezandClaude Opus 5.5 c79e1d3a9c fix(libc): list getifaddrs AF_LINK entries on macOS hosts
getifaddrs listed each interface's AF_LINK entry only on Linux. On macOS the
entry now comes from the host's own AF_LINK sockaddr_dl and if_data: index,
type (macOS and FreeBSD share the IFT_ numbers), hardware address, header
length, MTU, metric, baud rate and counters, with the link state from
SIOCGIFMEDIA, or from IFF_UP and IFF_RUNNING for an interface without media.
The interfaces test checks the link-level entries against the host's on macOS
too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 22:44:24 -03:00
Dean 4c6fcfcb5c Merge pull request #9763 from rooklz/fix/libc-freopen-closed-stream
fix(libc): reopen a closed stream in freopen instead of aborting
2026-10-28 13:48:50 +13:00
xXPBSXxandClaude Sonnet 5.5 893250cf72 Merge main (951399570d) into libm/asinh-msun
The only conflict was in GuestMath.cpp, where main's sinh tests and this
branch's asinh tests were inserted at the same place. Keep both: the asinh
checks follow the sinh ones.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 01:31:59 +01:00
Dean 057de19313 Merge pull request #11556 from xXPBSXx/libm/sinh-msun
fix(libc): compute sinh with FreeBSD msun's algorithm
2026-10-28 13:03:47 +13:00
Dean 9f605c98d2 Merge pull request #10283 from JJenkx/windows/libc-cbrt-msun
fix(libc): compute cbrt with FreeBSD msun's algorithm, as titles' libc.prx does
2026-10-28 13:01:01 +13:00
Dean 46b9aa3768 Merge pull request #9648 from JJenkx/windows/libc-rand-console
fix(libc): follow the console's rand, srand and rand_r
2026-10-28 13:00:35 +13:00
Dean 6e9b9134f6 Merge pull request #11846 from heditrigui/feat/libc-reallocarray
feat(libc): implement reallocarray
2026-10-28 12:10:58 +13:00
xXPBSXxandClaude Sonnet 5.5 944b4d753e Merge main (f5fefb982c) into carry/6713-default-heap-no-procparam
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 22:29:34 +01:00