shadPS4/src/core/libraries/libc_internal
Stephen Miller 6a7f8a9e5a
Libs.LibcInternal: _Fofind, _Lockfilelock, _Unlockfilelock, _Foprep, _Fopen, fopen, fflush, _Nnl, _Fspos, fseek, _Frprep, fread, _Fofree, fclose, _Mtxinit, _Mtxlock, _Mtxunlock, _Mtxdst implementations (#4019)
* Initial definitions

* internal__Fofind

* Libcinternal threads

fopen stores a valid pthread mutex in the FILE struct. Since this is exposed to the game/app, we need to handle this accurately.

* internal__Foprep (and various other functions called in it)

* Actual fopen implementation

At long last, an actual function I'm supposed to implement.

* fflush + compile fixes

* fseek implementation

Comes with functions fseek calls, aside from fflush which I pushed earlier.

* fread, _Frprep

Also changed some parameter names a tad to match how I named things in my decomp.
And fixed some bugs with how I was handling the weird offseted mode thing

* fclose, _Fofree

Not confident on this one, but we'll see I guess.

* Bug fixing

No more crashes at least, fread seems to be broken though.

* fopen bugfixes

Behavior now matches LLE, at least in how LLE font seems to use it.

* Fix _Frprep

Seems like everything works now?

* Logging

Probably going to need to swap lseek and read logs to debug/trace later but this is for debugging.

* Remove alignment check

Seems I must've misinterpreted some of what Ghidra spat out, since libSceNgs2 is calling with size 1, nmemb 4.

* Reduce fseek, fread logs to trace

* Clang
2026-02-11 08:13:28 +02:00
..
libc_internal_io.cpp Libs.LibcInternal: _Fofind, _Lockfilelock, _Unlockfilelock, _Foprep, _Fopen, fopen, fflush, _Nnl, _Fspos, fseek, _Frprep, fread, _Fofree, fclose, _Mtxinit, _Mtxlock, _Mtxunlock, _Mtxdst implementations (#4019) 2026-02-11 08:13:28 +02:00
libc_internal_io.h Libs.LibcInternal: _Fofind, _Lockfilelock, _Unlockfilelock, _Foprep, _Fopen, fopen, fflush, _Nnl, _Fspos, fseek, _Frprep, fread, _Fofree, fclose, _Mtxinit, _Mtxlock, _Mtxunlock, _Mtxdst implementations (#4019) 2026-02-11 08:13:28 +02:00
libc_internal_math.cpp Core: Remove checks for symbol version_major and version_minor (#3540) 2025-09-08 19:30:03 -07:00
libc_internal_math.h Libraries: Update libcInternal (#2265) 2025-02-14 09:58:38 +02:00
libc_internal_memory.cpp Core: Remove checks for symbol version_major and version_minor (#3540) 2025-09-08 19:30:03 -07:00
libc_internal_memory.h Libraries: Update libcInternal (#2265) 2025-02-14 09:58:38 +02:00
libc_internal_str.cpp Core: Remove checks for symbol version_major and version_minor (#3540) 2025-09-08 19:30:03 -07:00
libc_internal_str.h Libraries: Update libcInternal (#2265) 2025-02-14 09:58:38 +02:00
libc_internal_threads.cpp Libs.LibcInternal: _Fofind, _Lockfilelock, _Unlockfilelock, _Foprep, _Fopen, fopen, fflush, _Nnl, _Fspos, fseek, _Frprep, fread, _Fofree, fclose, _Mtxinit, _Mtxlock, _Mtxunlock, _Mtxdst implementations (#4019) 2026-02-11 08:13:28 +02:00
libc_internal_threads.h Libs.LibcInternal: _Fofind, _Lockfilelock, _Unlockfilelock, _Foprep, _Fopen, fopen, fflush, _Nnl, _Fspos, fseek, _Frprep, fread, _Fofree, fclose, _Mtxinit, _Mtxlock, _Mtxunlock, _Mtxdst implementations (#4019) 2026-02-11 08:13:28 +02:00
libc_internal.cpp Libs.LibcInternal: _Fofind, _Lockfilelock, _Unlockfilelock, _Foprep, _Fopen, fopen, fflush, _Nnl, _Fspos, fseek, _Frprep, fread, _Fofree, fclose, _Mtxinit, _Mtxlock, _Mtxunlock, _Mtxdst implementations (#4019) 2026-02-11 08:13:28 +02:00
libc_internal.h Libs.LibcInternal: _Fofind, _Lockfilelock, _Unlockfilelock, _Foprep, _Fopen, fopen, fflush, _Nnl, _Fspos, fseek, _Frprep, fread, _Fofree, fclose, _Mtxinit, _Mtxlock, _Mtxunlock, _Mtxdst implementations (#4019) 2026-02-11 08:13:28 +02:00
printf.h build: Fix a couple more warnings. (#3598) 2025-09-13 15:33:42 -07:00