Commit Graph
1260 Commits
Author SHA1 Message Date
Dean 746bdd8041 Merge pull request #8550 from Retr0G28/fix/fopen-directory-read-windows
fix(libc): open a directory with fopen in a read mode on Windows
2026-10-22 17:22:22 +13:00
Kang, Harry Zixuan 726edc503b feat(windows): support MSYS2 GCC runtime builds 2026-10-21 20:29:55 -07:00
Dean 6ef5a1c4c9 Merge pull request #8974 from rooklz/fix/call-trace-fixed-base
fix(libc): count call trace offsets from the first page of a non-PIE executable
2026-10-22 15:24:57 +13:00
Dean 1d2f8cfe0e Merge pull request #8859 from hypermoist/feat/libc-c11-thread-forwards
feat(libc): forward the C11 thread and TSS calls to libkernel
2026-10-22 01:54:23 +13:00
Retr0 36226741f5 fix(libc): open a directory with fopen in a read mode on Windows
FreeBSD 11 fopen opens the path with _open, and vn_open_vnode refuses a
directory only for FWRITE or O_TRUNC, so fopen of a directory in a read
mode succeeds; Linux hosts already open it. On Windows CreateFileW
without FILE_FLAG_BACKUP_SEMANTICS refused it with EACCES.

fopen now opens such a path as a libkernel directory descriptor, which
libkernel registers in libc when it loads, and fclose and freopen remove
it from libkernel's table. Reads on the stream fail with EISDIR and set
the error indicator, as on a Linux host and FreeBSD's tmpfs: the Windows
CRT fails them already but reports EINVAL. Writes fail with EBADF, and
fseek, ftell and ungetc work, as on any read-only stream.
2026-10-21 14:48:37 +03:00
Adrià 59776f2e6a Merge pull request #7841 from hypermoist/feat/libc-annex-k-remaining
feat(libc): implement the remaining C11 Annex K bounds-checking functions
2026-10-21 13:09:59 +02:00
Adrià eb4a7fee4e Merge pull request #7525 from AlexOfTheForest/feat/scanf-wide-linux
feat(libc): scan 16-bit wide conversions in the sscanf family on Linux
2026-10-21 13:09:54 +02:00
Adrià 0a5080477f Merge pull request #6655 from al3w0f205/perf/hybrid-cpu-topology-worker-pinning
feat(libc): support multi-tier hybrid cpu topology in LayoutFromClasses
2026-10-21 13:01:57 +02:00
Dean a1f95a523f Merge pull request #8849 from hypermoist/fix/libc-integer-base
fix(libc): follow the console for integer bases and 0x prefixes
2026-10-21 23:46:18 +13:00
Dean e6ebe8a8b7 Merge pull request #8857 from Dripl1x/perf/direct-memory-section-pool
perf(libkernel): reuse released direct-memory sections that never held data
2026-10-21 22:20:39 +13:00
Rookie 0a2ba6ed9a fix(libc): count call trace offsets from the first page of a non-PIE executable 2026-10-21 09:00:05 +01:00
Dean f894ba69d3 Merge pull request #8479 from hypermoist/feat/libc-wide-stream-scanf
feat(libc): add the wide stream scanf family
2026-10-21 20:58:24 +13:00
Dean ee613abc2a Merge pull request #8324 from hypermoist/feat/libc-timezone-daylight
feat(libc): export timezone and daylight
2026-10-21 20:57:08 +13:00
Dean b77bd58806 Merge pull request #8226 from dantdmdarealguy/fix/libc-update-stream-read-windows
fix(libc): switch update streams to reading as FreeBSD does
2026-10-21 19:57:35 +13:00
Dean 5b5d2a8636 Merge pull request #8626 from xXPBSXx/carry/6226-relinker-stem
fix(libc): find a relinked module by stem when the exact name misses (carries #6226)
2026-10-21 19:52:46 +13:00
Dean eb9f904d32 Merge pull request #8801 from xXPBSXx/fix/dot-component-through-file
fix(libc): fail a path that ends in a dot component below a regular file with ENOTDIR on Windows
2026-10-21 18:36:28 +13:00
Dean 1ff5c8ac5c Merge pull request #8217 from xXPBSXx/fix/rename-dot-component-fb
fix(libc): report a status error of the rename parent directory instead of ENOENT or ENOTDIR
2026-10-21 18:00:40 +13:00
Dean 2923f29cf1 Merge pull request #8842 from UnhealthyKraken/feat/libc-index
feat(libc): implement index string search
2026-10-21 16:35:20 +13:00
hypermistandClaude Opus 5.5 8bddc39245 feat(libc): forward the C11 thread and TSS calls to libkernel
_Call_once, _Tss_create, _Tss_delete, _Tss_get, _Tss_set, _Thrd_equal,
_Thrd_current and _Thrd_exit call scePthreadOnce, scePthreadKeyCreate,
scePthreadKeyDelete, scePthreadGetspecific, scePthreadSetspecific,
scePthreadEqual, scePthreadSelf and scePthreadExit and return their
results unchanged, as the console's libSceLibcInternal does.
_Mtx_current_owns returns 1 there. libkernel registers the calls with
libc at load, next to the pthread_create registration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-21 16:31:00 +13:00
hypermistandClaude Opus 5.5 8e46144d48 fix(libc): follow the console for integer bases and 0x prefixes
- strtol, strtoul, strtoll, strtoull and strtouq return 0 for a base
  outside 0 and 2 to 36, leave the end at the start and set EINVAL;
  strtoimax, strtoumax, _Stoull, _Stoul and the wide forms do the same
  without errno.
- A 0x prefix with no hexadecimal digit after it (base 0 or 16) is no
  conversion: the end stays at the start of the string.
- wcstol, wcstoll and wcstoimax take one sign, convert the rest with
  wcstoull and clamp to the signed range with ERANGE, so "- 1" is -1
  and "+\t-1" overflows.
- atoi, atol and atoll truncate strtoull's result.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-21 16:05:00 +13:00
Dean 5d10ea9ea0 Merge pull request #8791 from JJenkx/windows/calltrace-faulting-thread
feat(libc): list the reporting thread's own calls in the call trace report
2026-10-21 15:40:39 +13:00
Evgeniy KazarinandClaude Opus 5.5 69f843c910 perf(libkernel): reuse released direct-memory sections that never held data
The title allocates, maps and releases about 48 direct-memory blocks per frame.
Each allocation created a pagefile-backed section and each release closed it.
A released section whose pages were never stored to (resident pages keep their
data in private memory and saved buffers, not in the section) is still blank,
so up to 256 such sections of at most 16 MiB, 256 MiB in total, are kept by
size and handed to the next allocation of that size instead of a new
CreateFileMappingW. APS5_NO_DIRECT_MEMORY_SECTION_POOL keeps the old behaviour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 10:32:44 +08:00
Kraken 20e95370ae feat(libc): implement index string search 2026-10-21 03:29:12 +01:00
Dean d10d9d214c Merge pull request #8782 from valenciana-nc/fix/execute-once-independent-flags
fix(libc): avoid deadlocking independent once initializers
2026-10-21 15:27:24 +13:00
Dean GalvinandxXPBSXx 8cb7251b2e Merge origin/main into PR 8626
Co-authored-by: xXPBSXx <[email protected]>
2026-10-21 14:56:22 +13:00
Dean b13183e59e Merge pull request #7473 from Dripl1x/codex/skip-clean-resident-write-watch
perf(libc): skip write-watch queries for proven clean resident ranges
2026-10-21 14:55:09 +13:00
Dean 6c12024f7d Merge pull request #8741 from Queuse/fix/libc-freopen-share-delete
fix(libc): share delete on standard stream reopen
2026-10-21 14:47:29 +13:00
Dean 994829e44b Merge pull request #8733 from p3n1cillin/codex/libc-unlocked-status-20261020
feat(libc): implement unlocked stream status queries
2026-10-21 14:24:31 +13:00
xXPBSXxandClaude Sonnet 5.5 035d82b571 fix(libc): fail a path that ends in a dot component below a regular file with ENOTDIR on Windows
FreeBSD looks the "." up in the directory before it, so "file/." fails with
ENOTDIR and "missing/." with ENOENT (sys/kern/vfs_cache.c vfs_cache_lookup,
`dvp->v_type != VDIR`). Resolve() dropped a trailing "." and handed the
host "file/", which stat, access, open and mkdir answered with ENOENT,
EINVAL or EEXIST. The ".." branch already checks the directory first;
do the same for a path whose last component is ".".

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-21 03:08:16 +02:00
Dean 67f25e4681 Merge pull request #7470 from Dripl1x/codex/exact-resident-release
perf(libc): release exact resident mappings without repeated queries
2026-10-21 14:07:25 +13:00
Dean 1ffe979127 Merge pull request #8576 from priyanshrv-netizen/feat/libc-float-characteristics
feat(libc): export the Dinkumware float characteristic tables
2026-10-21 14:06:48 +13:00
Dean 46c7538777 Merge pull request #7467 from Dripl1x/codex/windows-path-component-lookup
perf(libc): avoid repeated Windows path component scans
2026-10-21 13:57:05 +13:00
al3w0f205 80780f2899 feat(libc): support multi-tier hybrid cpu topology in LayoutFromClasses 2026-10-20 19:32:31 -05:00
Evgeniy KazarinandClaude Opus 5.5 b5bb956530 test(libc): link the resident release test and keep its valid case in one run
The test throws exceptions but did not link libc, so with
-fno-asynchronous-unwind-tables it failed to link (no __gxx_personality_v0)
on the supported WinLibs toolchain; the Windows CI job does not run on pull
requests. The valid case now maps 2 MiB at a 2-MiB boundary, so the mapping is
one resident run and both Reset calls take the exact-run path, and the test
requires that run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 08:30:15 +08:00
Dean 21a57ff5c0 Merge pull request #8570 from priyanshrv-netizen/feat/libc-dinkumware-constants
feat(libc): export the remaining Dinkumware floating-point constants
2026-10-21 13:29:16 +13:00
JJenkxandClaude Opus 5.5 3316ca3b24 feat(libc): list the reporting thread's own calls in the call trace report
The crash and abort reports printed the last 64 traced calls of the whole
process, so a thread that loops on a traced import (a mutex lock/unlock
pair, a profiler marker) pushes the calls of the faulting thread out of the
report. The ring already keeps the last 65536 calls with their thread.

CopyThreadCallTrace_nid_no_patch returns the most recent calls of one
thread from that ring, oldest first, and both reports (Windows crash and
abort, Linux abort) list up to 32 of them for the reporting thread after
the process-wide list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 20:25:31 -04:00
Dean c82867c77c Merge pull request #7472 from Dripl1x/codex/reuse-unreferenced-saved-memory
perf(libc): reuse saved direct-memory buffers when unreferenced
2026-10-21 13:25:04 +13:00
Dean b56cfb3817 Merge pull request #8444 from SwetabhSingh17/feat/libc-mem-utilities
feat(libc): implement memmem and memccpy
2026-10-21 13:24:46 +13:00
Dean 07c67a0d6d Merge pull request #8640 from Dom3005/fix/windows-open-symlink-loop-eloop
fix(libc): map a Windows symbolic link loop to ELOOP when opening
2026-10-21 13:13:01 +13:00
Dean 33a6d6bbfb Merge pull request #8635 from dantdmdarealguy/fix/libc-thread-name-test-personality
fix(libc): link the thread-name test against libc for its personality routine
2026-10-21 13:12:11 +13:00
Dean 70c497739e Merge pull request #8636 from cadenasynyster/fix/libc-thrd-detach
feat(libc): implement _Thrd_detach
2026-10-21 13:11:55 +13:00
valenciana-nc 42412ac274 fix(libc): run once initializers outside the shared mutex 2026-10-20 18:06:49 -06:00
Dean 55027392ed Merge pull request #8535 from ycbuzi/pr/libc-fmax-signaling-nan
fix(libc): keep fmin and fmax quiet on a signalling NaN
2026-10-21 13:02:51 +13:00
hypermist 8baefcf14c Merge remote-tracking branch 'upstream/main' into feat/libc-annex-k-remaining 2026-10-21 12:43:56 +13:00
Dean 5b59fbc553 Merge pull request #8389 from SwetabhSingh17/feat/libc-math-significand
feat(libc): implement significand
2026-10-21 12:40:42 +13:00
Dean c298bd3d57 Merge pull request #8446 from hypermoist/feat/libc-basename-r
feat(libc): implement basename_r
2026-10-21 12:40:20 +13:00
Dean f69bb8e4d4 Merge pull request #8440 from mazen320/fix/printf-alternate-octal-zero
fix(libc): preserve zero in alternate wide octal formatting
2026-10-21 12:40:10 +13:00
Dean 559f35d685 Merge pull request #8442 from hypermoist/feat/libc-fenv-traps
feat(libc): add the floating-point trap controls
2026-10-21 12:25:36 +13:00
Dean a8b92e43ce Merge pull request #8396 from Chuk49/feat/libc-wcstombs-s
feat(libc): export wcstombs_s
2026-10-21 12:21:12 +13:00
Dean 273b1b87f4 Merge pull request #8388 from SwetabhSingh17/feat/libc-paf-mspace-posix-memalign
feat(libc): implement sceLibcPafMspacePosixMemalign
2026-10-21 12:20:57 +13:00