Commit Graph

32 Commits

Author SHA1 Message Date
Adrià fffe7351ad
Merge pull request #4625 from QRMOE/fix-libc-strtok-exhausted-state
fix(libc): clear exhausted strtok continuation state
2026-10-13 16:59:43 +02:00
Dean b9f194a890
Merge pull request #4455 from SibteProf/fix/libc-secure-copy-size-limits
fix(libc): reject oversized secure copy destinations
2026-10-13 07:26:35 +13:00
Dean f30e89ee7c
Merge pull request #4365 from Gashrod1/fix/libc-strxfrm-truncation
fix(libc): truncate strxfrm like FreeBSD's C locale
2026-10-13 07:20:51 +13:00
QRMOE 0950b19854
test(libc): cover exhausted tokenizer state 2026-10-12 19:01:27 +02:00
Dean 4bf963d660
Merge pull request #3966 from MarcZX100/codex/carry-strcasecmp-lowered
fix(libc): compare strcasecmp results after lowercasing bytes
2026-10-13 01:56:24 +13:00
SibteProf 5ffafa920f fix(libc): reject oversized secure copy destinations 2026-10-12 17:06:54 +05:00
m.peau e19e9145dd fix(libc): truncate strxfrm like FreeBSD's C locale
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-12 09:42:28 +02:00
Hussein Kadhim aaf49fb40f fix(libc): compare strcasecmp and strncasecmp results after lowering
FreeBSD returns the difference of the lowercased bytes where the strings
differ, including where one of them ends. The guest wrappers returned the raw
difference of the terminator and the unfolded byte, so strcasecmp("ab", "A")
gave 66 instead of 98.
2026-10-11 19:49:35 +00:00
QRMOE 97409a6d08
test(libc): cover dirname result length boundaries
Cover 16 paths with long leaves, exact-fit and overlong directory results, repeated separators, input preservation and guest errno. The regression reports 12 failures on unchanged main and passes with the accompanying fix.

AI-assisted: yes
2026-10-11 16:25:14 +02:00
Adrià f0d15c3d81
Merge pull request #3261 from MarcZX100/codex/libc-dirname-ppsA99764
feat(libc): implement dirname
2026-10-11 09:25:39 +02:00
Adrià 379e5d8795
Merge pull request #3280 from MarcZX100/codex/libc-memset-s-freebsd-3166
fix(libc): follow FreeBSD memset_s errors
2026-10-11 09:18:14 +02:00
MarcZX100 bde216731e fix(libc): preserve dirname input paths 2026-10-11 05:12:21 +00:00
MarcZX100 7d7b405b3c test(libc): cover dirname separator and boundary cases 2026-10-11 05:10:13 +00:00
MarcZX100 865e530505 feat(libc): implement dirname 2026-10-11 05:10:13 +00:00
Fishybeing 007cc62555 fix(libc): follow FreeBSD's memset_s errors
FreeBSD's memset_s returns EINVAL for every constraint violation and writes nothing when smax or n exceeds RSIZE_MAX. The guest returned ERANGE when n exceeded smax and wrote up to min(n, smax) bytes even when smax or n exceeded RSIZE_MAX.

(cherry picked from commit bf08837cf929e40f1b646df82e140a33076d5587)
2026-10-11 05:05:02 +00:00
Achraf Reyani 0f480c6acc feat(libc): implement strsep
Split at the first delimiter like FreeBSD's strsep: empty fields are
returned, and the cursor becomes null after the last token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 09:48:07 +09:00
Achraf Reyani 471e537cdf feat(libc): implement __inet_ntoa
Format the address bytes in network order as dotted decimal into a
per-thread buffer, like FreeBSD's inet_ntoa returns its static one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 12:43:51 +09:00
Adrià e66180f1bb
Merge pull request #1972 from babyhuey/feat/libc-inet-addr
feat(libc): implement __inet_addr
2026-10-10 00:35:34 +02:00
Adrià e51d4e1f21
Merge pull request #1812 from journaltraces/feat/libc-stpcpy
feat(libc): implement stpcpy
2026-10-10 00:08:33 +02:00
Hannah Lyons 128d2e81dc test(libc): pin __inet_addr to FreeBSD one-part wrap 2026-10-10 00:00:38 +02:00
Hannah Lyons 11e058654d feat(libc): implement __inet_addr 2026-10-10 00:00:38 +02:00
LeandroLP23 7449e51483 feat(libc): implement __inet_aton
PICO-8 for PS5 (PPSA99808) stops at start-up on the unresolved import
a7ToDPsIQrc from libSceLibcInternal. The parser follows FreeBSD's inet_aton
(lib/libc/inet/inet_addr.c): one to four parts in decimal, octal or hex, the
last part filling the remaining bytes, input ending at a NUL or whitespace,
and a null address only validating.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 23:48:48 +02:00
journaltraces e411282b80 feat(libc): implement stpcpy
PICO-8 for PS5 (PPSA99808) imports stpcpy from libSceLibcInternal, one
of the absent imports #1578 lists for it. POSIX defines it as strcpy
that returns a pointer to the terminating null of the copy.
2026-10-09 00:22:57 +03:00
Madan Kumar 47c1b8e592
fix(libc): only fail sscanf_s fields when the buffer capped the width
A %s or %[ field was treated as overflowed whenever the next input
character could continue it, even when the field width from the format
ended the read. sscanf_s("abcdef", "%3s", buf, 10) returned 0 with an
empty buffer instead of 1 with "abc". Run the overflow check only when
the buffer capacity reduced the width.
2026-10-07 16:25:11 +05:30
Ethan Barr 0653b87497 fix(libc): reject overlapping memcpy_s ranges 2026-10-06 14:26:37 -07:00
Cliff Syner b9c1c8848f feat(libc): implement strnlen_s
The DQbtGaBKlaw import was a throwing stub (libcCyberUnknown17). It is
the NID of "strnlen_s", which C11 K.3.7.4.4 defines as strnlen that
returns 0 for a null pointer.

The removed stub comment from #358 described its call site as
float -> float, which contradicts the hash-verified name; #492 left the
stub untouched for that reason.
2026-10-05 18:26:06 +00:00
boykopovar 244b915c75
Merge branch 'main' into feat/libc-runtime-functions 2026-09-28 09:01:41 +03:00
Dean Galvin 20cc23438f feat(libc): sscanf_s on linux
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
2026-09-28 16:53:29 +13:00
Dean Galvin a599eca727 feat(libc): operator new/delete, bounds-checked functions, char locale facets and runtime helpers
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
2026-09-28 14:22:48 +13:00
SamG-Coder 39b81364b7 feat(libc): add C-locale character APIs and guest basename 2026-09-25 06:58:41 +10:00
SamG-Coder 730afc79f8 feat(libc): add independent guest strtok state 2026-09-25 06:52:05 +10:00
SamG-Coder 6ba24a895c feat(libs): implement homebrew string compatibility functions 2026-09-25 05:59:07 +10:00