Repository navigation
fix(libkernel): translate fsync errors for guest callers - #2030
Closed
STUPIDCONTEM wants to merge 1 commit into
Closed
STUPIDCONTEM wants to merge 1 commit into
STUPIDCONTEM wants to merge 1 commit into
Conversation
9 tasks done
MarcZX10
approved these changes
Oct 9, 2026
MarcZX10
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the full three-file diff at 7ea7f59. The kernel API now returns the project’s encoded error and preserves errno; the POSIX wrapper uses the existing PosixResult path. The new test covers regular files, sockets, invalid/closed descriptors, and errno behavior. Exact-head Linux/GCC 12.2 build passed and guest_fsync passed (1/1, 0.05 s); conventions and diff checks pass. The author reports the Windows run and full CTest. GitHub currently reports no checks.
8 of 9 tasks
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evidence review (2026-10-09)
Game/title evidence has not been established. Validation below is host regression/build evidence only; it does not establish title compatibility. Older checked items and test results describe their stated revisions, not current merge readiness.
Game/title ID: none verified. No PS5 title execution is claimed.
What
sceKernelFsyncreturned the host's-1on failure instead of an encoded kernel error. It also sent guest socket descriptors to the host CRT, which could only report an invalid descriptor.Translate native failures through the existing kernel error mapping and preserve the caller's errno in the kernel entry point. The POSIX
fsyncwrapper now decodes the kernel result into-1plus guest errno. Open guest sockets return EINVAL, and invalid/closed descriptors return EBADF.The socket/invalid-descriptor distinction follows FreeBSD 11 fsync; the kernel encoding is the project's existing KernelErrors/SceErrorFromErrno convention. Regular files still use the existing host flush operation.
Tested
Windows 10 Pro 19045, WinLibs MinGW-w64 GCC 15.2.0 UCRT/posix/SEH r7, Ninja Release, BUILD_TESTING=ON, SPIRV-Tools disabled. Based directly on
f145139676a48306681d3a4d5fabf83938759daf; independent of #2029.guest_fsyncfails against upstream atkernel result encodes the guest error.guest_fsync,guest_filesystem, andguest_kernel_sync: 3/3 passed.libsbuilds succeed.Linux and PS5 hardware/title behavior were not tested. The regression checks API results, not crash/power-loss durability.
Overlap review: #1738 registers a terminal test at the same CMake insertion point; it changes different production functions and is not a dependency. #2001 deletes the POSIX fsync wrapper as part of broader removals; it does not implement the error translation here. This PR remains independently based on main; overlapping hunks need reconciliation if either change lands first.
An external review approved this exact head and reports a Linux/GCC 12.2 build plus passing
guest_fsync(1/1). This is reviewer-reported validation, separate from the local Windows results above.Checklist
main; no other open PR implements the same change (historical base; current readiness not asserted)