feat(libSceLibcInternal): implement __fflush #14872
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14872"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by heditrigui on 2026-11-01T21:59:08Z.
What
Implements
__fflushinlibSceLibcInternal(core/libs/prx/libSceLibcInternal/Stream.cpp), replacing its inventory stub declaration inInventoryExports.cpp(libSceLibcInternalInventory_262_nid_no_patch):__fflush(NIDE1iwBYkG3CM): reusesfflush_nid_postfix(stream)rather than FreeBSD 11.4 libc's unlocked single-stream helper (fflush.c@8c639945a4): acquires stream locks and returns -1 withEBADF(9) on a closed stream (where FreeBSD returns 0 for a stream with 0 flags). Passingnullptrflushes all open streams and returns 0 when all writes succeed or EOF on write error.Tested
core/libs/tests/GuestLibcInternalStream.cpp(guest_libc_internal_stream_tests) verifying:__fflush_nid_postfix(stream)flushes the payload to disk matching disk contents before callingfclose_nid_postfix.FileStream::Close()and calling__fflush_nid_postfix(&closedStream)fails returning-1witherrno == 9(EBADF).streamAandstreamB), writing uncommitted payloads to both, and calling__fflush_nid_postfix(nullptr)commits both files' payloads to disk beforefclose.python tools/check_conventions.py --base upstream/main --head HEAD(all conventions checks passed; 0 errors).python core/libs/tests/test_public_headers.py --audit-only(399 libraries, 26,744 exports checked; 0 errors).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)