AnyPS5/core/libs/prx/libc/include
marshmll 438d410824 fix(libc): keep host diagnostics on stderr when a guest redirects it on Linux
On Linux a guest stderr redirect also moves the host's: guest
descriptors are host descriptors, and the guest stderr stream wraps the
host stderr FILE. After dup2(fd, 2), or freopen(path, mode, stderr) with
full buffering, the libc terminate report, the host fprintf(stderr)
diagnostics and libstdc++'s terminate message go into the title's pipe
or file, and abort() discards what is still buffered. RetroArch
(PPSA99169) reopens stderr onto app0/trace.txt with full buffering, so
its stop on main left no message anywhere.

Before the first guest redirect of descriptor 2 (libkernel dup2, libc
freopen of a stream on descriptor 2), keep a close-on-exec duplicate of
the host descriptor 2 and point the host stderr at an unbuffered stream
on it. The guest stream keeps its own FILE and follows the redirect.
The libc terminate report writes to the kept descriptor with write()
instead of the stderr stream, and libkernel's sceKernelDebugOutText uses
the same kept descriptor.
2026-10-12 19:00:08 -03:00
..
exceptions feat(agc): write the worker sampler's stacks as collapsed stacks 2026-10-12 21:23:11 +02:00
general fix(libc): write each log line in one call 2026-10-11 13:23:21 -04:00
specifics refactor(libc): define the PROCMAP_QUERY permission flags in HostMapping 2026-10-11 07:44:34 -03:00
ApplicationHeap.hpp feat(libc): implement malloc_usable_size 2026-10-11 04:41:39 +02:00
CpuTopology.hpp perf(agc): pin the queue workers to the performance cores on Linux 2026-10-05 21:23:34 +13:00
CreationMask.hpp fix(libkernel): preserve patched loading and shared-memory object identity 2026-10-11 23:40:46 +02:00
FileLock.hpp fix(libs): share Windows flock state between duplicated descriptors 2026-10-12 16:03:47 +02:00
FileStream.hpp fix(libc): keep host diagnostics on stderr when a guest redirects it on Linux 2026-10-12 19:00:08 -03:00
FilesystemError.hpp fix(filesystem): reject invalid parent traversal on Windows 2026-10-12 01:25:02 +05:30
General.hpp fix(libc): keep host diagnostics on stderr when a guest redirects it on Linux 2026-10-12 19:00:08 -03:00
GuestAllocations.hpp fix(agc): import GPU-mapped guest memory when it is mapped 2026-10-11 00:23:23 +02:00
GuestArena.hpp fix(libkernel): reserve the AMM ranges below host regions at the top of the guest arena 2026-10-11 17:09:12 +02:00
GuestDirectory.hpp feat(libSceLibcInternal): implement fdopendir 2026-10-12 16:23:42 -03:00
GuestHeap.hpp Merge pull request #3213 from Raghav314/fix/libc-heap-without-gpu 2026-10-11 09:14:14 +02:00
GuestLocale.hpp feat(libc): implement collate<char>::_Getcat 2026-10-06 14:53:47 +02:00
GuestStacks.hpp feat(libkernel): implement getcontext, setcontext and makecontext 2026-10-11 13:00:38 +03:00
GuestTime.hpp fix(libc): convert times into the guest's 56-byte tm on Windows 2026-10-10 02:13:17 +02:00
GuestWriteWatch.hpp fix(agc): host imports write-protect only pages a collect already protects 2026-10-10 11:38:28 +05:30
HeapDiagnostics.hpp feat(libc): implement heap trace info 2026-09-27 11:43:36 +03:00
HostEntropy.hpp fix(libs): take guest entropy from the host OS instead of std::random_device 2026-10-11 22:07:49 -03:00
HostThreadLocal.hpp fix(agc): preserve recorder buffers through Windows thread teardown 2026-09-28 09:55:01 +10:00
PreciseWait.hpp fix(libs): keep thread_local objects with destructors out of module teardown on Windows (#4029) 2026-10-12 18:25:29 +13:00
Shutdown.hpp fix(libc): end the process without detach routines in _Exit on Windows 2026-10-10 21:20:29 +13:00
SonyCrt.hpp feat(libc): implement __umodti3 2026-10-12 12:26:15 +00:00
WindowsFormatting.hpp fix(libc): print the guest errno message for %m in the printf family 2026-10-12 03:12:27 +00:00
WindowsMappings.hpp perf(libkernel): commit Windows direct backing when mapped 2026-10-12 07:59:34 +04:00
WindowsScanning.hpp fix(libc): return 0 from scanf when input fails after a suppressed conversion on Windows 2026-10-11 12:12:48 +02:00