Commit Graph

15 Commits

Author SHA1 Message Date
Adrià Franch e7605c8fd6 feat(libc): implement rewind
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-11 02:54:24 +02:00
Hannah Lyons 92c9296ae3 feat(libc): implement flockfile and funlockfile
(cherry picked from commit d32eaf181aadf79efc4199b22591f1f5f228d00c)
2026-10-10 21:49:58 +00:00
Scott Schuster 8bba489932 fix(libc): parse fopen and freopen modes as FreeBSD does
FreeBSD's __sflags reads the access character, then b, +, x, e and v, and
stops at the first other character without failing, so "rt" opens for
reading. On Windows fopen inserted b after the first character and passed
the rest on, so "rt" became "rbt", the CRT rejected it with EINVAL, and
fopen threw. vkQuake opens history.txt with "rt" at startup. freopen
accepted only a fixed list of modes.

Both now parse the mode like __sflags. An unknown access character, or x
on a read-only stream, returns NULL with EINVAL; x on an existing file
returns NULL with EEXIST; e and v are accepted and ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 00:48:13 -05:00
LeandroLP23 2e9ab8cc59 fix(libc): give setvbuf a default buffer when the size is 0
FreeBSD's setvbuf takes a zero size with _IOFBF or _IOLBF as "pick the
buffer size". The UCRT rejects sizes below 2 for those modes through
its invalid parameter handler, so the call failed on Windows and a test
process was terminated. A zero size now drops the given buffer and
asks the host for one of BUFSIZ bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 09:58:38 +02:00
Dean a2073010c4
Merge pull request #972 from ebarr24/codex/libc-fscanf-abi
fix(libc): translate Windows fscanf guest arguments
2026-10-07 15:14:30 +13:00
Ethan Barr 73facbc3d1 fix(libc): translate Windows fscanf guest arguments 2026-10-06 13:45:10 -07:00
Ethan Barr 34689f39ca fix(libc): preserve guest stdio bytes on Windows 2026-10-06 13:41:25 -07:00
Nicolas Abosch 7789c0a57b feat(libs): implement homebrew libc and kernel runtime exports 2026-10-05 22:40:16 -03:00
asimplestray 85a0ec2e69 fix(libc): convert sysv va_list for fscanf on Windows 2026-09-29 21:32:30 +00:00
asimplestray 77194e4561 feat(libc): implement fputwc, fputws and fscanf 2026-09-29 21:25:07 +00:00
SamG-Coder f37fffdacd feat(libc): expose guest vsprintf formatting 2026-09-25 07:26:06 +10:00
SamG-Coder dd0debe967 feat(libc): reopen guest streams while preserving identity 2026-09-25 07:05:07 +10:00
SamG-Coder 79edb20f17 fix(libc): preserve 64-bit guest stream offsets 2026-09-25 07:00:45 +10:00
SamG-Coder f49cace1ca feat(libc): implement guest formatted stream output 2026-09-25 06:35:32 +10:00
SamG-Coder e8ecb29170 feat(libc): expose guest standard streams and character IO 2026-09-25 06:30:30 +10:00