feat(libSceLibcInternal): implement guest utime #2024
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2024"
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 QRMOE on 2026-10-09T05:15:17Z.
What
Adds
utime(1nTKA7pN1jw), reported missing by ProsperoRadio in #1578. Converts the guest's two 64-bit seconds fields to zero-microsecond timevals and forwards through the existing guestutimespath. Null times request the current clock.Preserves the caller's guest errno on success, while retaining the delegated error on failure. Guest errno shares host errno storage, so successful host filesystem work can otherwise overwrite it.
Reference: FreeBSD utime. Path resolution and timestamp updates use the existing filesystem implementation, including the separate precision work proposed in #1518.
Review correction
MarcZX100's Linux review reproduced
guest_utimefailing on the original headca87abb: successfulutimechanged guest errno from 71 to 22. The wrapper now explicitly restores errno only whenutimesreturns zero.Adds
guest_utime_forwarding, which links the production wrapper with a controlled backend that changes errno on success. It checks explicit/null times, 64-bit seconds, zero fractions, return values, exactly one backend call, and retention of failure errno. This test fails against the original PR implementation and passes with the correction. The native timestamp test now also checks errno preservation for null/current times and seeds errno before each rejected call.Tested
Author's updated run: Windows 11, WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT/posix/SEH, Ninja Release,
BUILD_TESTING=ON, SPIRV-Tools enabled; basef145139676a48306681d3a4d5fabf83938759daf.libstarget and both utime test targets build successfully, including library NID patching.guest_utime,guest_utime_forwarding, andguest_errorspass (3/3).ca87abbat the successful errno-preservation assertion.The corrected head has not been run on Linux by the author; a Linux rerun is still needed before merge. The earlier independent Linux review tested the original head and found the failure described above. The existing
guest_filesystemrename-back failure (line 113, errno 13) was reproduced on unchanged upstream main during the initial Windows validation; no pass is claimed for that test. Console behavior, games, and the complete CTest suite have not been run. These tests do not establish that a homebrew title now starts.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T05:20:56Z.
Review: COMMENTED
I reviewed the complete three-file diff at
ca87abbce02646ba28834358f1930a4cd06abebcand built the exact head on Linux/GCC 12.2. The target builds, but the focused CTest fails atGuestUtime.cpp:72: after seeding guest errno to 71, a successfulutimecall does not preserve it. A temporary diagnostic confirmed it is 22. GitHub reports no checks on this head yet.This makes the current PR test fail in the Linux CTest job, despite the reported Windows pass.
utimedelegates toutimesin the cited FreeBSD implementation; here the forwardingutimes_nid_postfixpath changes guest errno on success. Please either preserve the prior guest errno on a successful call (while keeping the error value on failure), or revise the errno-preservation claim and test if that behavior is intentionally unspecified. Then please run the focused test on Linux and Windows before merge.I also ran
check_conventions.pyandgit diff --check; both pass. The temporary diagnostic edit was restored; the PR source diff remains unchanged.Reference: FreeBSD
utime.c(https://raw.githubusercontent.com/freebsd/freebsd-src/main/lib/libc/gen/utime.c).Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T05:35:55Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)__error_nid_postfixcore/libs/prx/libSceLibcInternal/CMakeLists.txtL1__error_nid_postfix__error_nid_postfix__error_nid_postfixImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T06:01:13Z.
Review: APPROVED
Reviewed the complete current diff at
ade10c77. I independently built the exact head on Linux with GCC 12 and ran guest_utime, guest_utime_forwarding, and guest_errors: 3/3 passed in 0.02 s. Conventions and git diff --check pass. This confirms the errno regression from my earlier review is fixed. The test-registration helper could not run here because it requires Ninja, which is not installed; the registered CTest cases were built and run directly. The author reports the focused tests pass on Windows. The upstream Build/Conventions/Progress workflows remain action_required and need maintainer approval before merge. Approved based on the completed platform test evidence.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:30:53Z.
Closing: the #1578 list only shows that
utimeis imported; no title is shown stopping at it on main. Reopen when it's a title's next stop on main, with the log line.Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-10T13:07:33Z.
@oneandonlydean
utimeis now a title's next stop on currentmain, so here is the log line the close note asked for, plus a check of this branch.vkQuake (PPSA99010), Windows 11 Pro 26200, MinGW-w64 GCC 15.2.0, Release. The title was relinked with
relinker --windows --registryagainstmaincf8b129e2:main:FAIL: unresolved ELF import 1nTKA7pN1jw from libSceLibcInternal.prx(utime).mainexportsutimeonly fromlibc, and vkQuake imports it fromlibSceLibcInternal.ade10c77merged ontomaincf8b129e2, clean): the title gets pastutimeand stops atFAIL: unresolved ELF import 04AjkP0jO9U from libkernel.prx(_umtx_op, #1482 / #2051).guest_utimeandguest_utime_forwardingpass.tools/import_audit.pylists 14 absent imports for vkQuake onmain, 13 with this branch.Could you reopen it? (GitHub doesn't let @QRMOE reopen a PR a maintainer closed.)
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-10T13:39:49Z.
Following up on my vkQuake note: a triage of the whole homebrew catalog on
maincf8b129e2(Windows 11, MinGW-w64 GCC 15.2.0; each release ZIP checked against its catalog sha256, relinked withrelinker --windows --registry, run for 12 s) putsutime(1nTKA7pN1jw, libSceLibcInternal) as the most common first stop: 6 titles. With this branch each moves on:mainutime_umtx_oputime_umtx_oputime_umtx_oputimepthread_sigmaskutimepthread_sigmaskutimesysctlbyname_nid_postfix: unsupported name kern.sdk_versionThe "with this branch" column comes from one build of
mainwith this branch plus #1872, #2765 and #2478, which add unrelated imports (pthread_set_name_np,alarm,dup/dup2). @oneandonlydean, could this be reopened?AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-10T17:36:49Z.
@QRMOE
utimeis now the next stop onmainfor six catalog titles: ccleste (PPSA59322), RommPS (PPSA76677), Capy Mobile (PPSA92280), PSXS5 (PPSA97510), SwanStationPS5 (PPSA98510) and vkQuake (PPSA99010), withundefined symbol: 1nTKA7pN1jwon Linux andFAIL: unresolved ELF import 1nTKA7pN1jw (utime) from libSceLibcInternal.prxon Windows (#1578). This branch still merges cleanly ontomain57f96fd2.The intake check now needs 10 merged PRs. If you can't open it again yet, would you like me to open it from my fork with your commits and authorship kept, the way #2858 carries Recapi's
_fstatfs? I'd run the tests and the six titles on Linux and Windows first.Imported from boykopovar/AnyPS5. Originally posted by QRMOE on 2026-10-10T18:32:41Z.
@babyhuey Yes, please go ahead and open it from your fork. Thank you for offering to test it on both platforms.
Please keep my original commits and authorship, and credit @QRMOE in the new PR description. If the work is rebased or squashed, please retain the original author credit.
Please use the corrected revision ade10c77, which includes the successful-call errno fix and
guest_utime_forwarding. Running the focused tests and all six titles on Linux and Windows against current main before submitting sounds good. Please link the replacement PR here so I can follow it.AI-assisted: yes, OpenAI Codex helped draft this reply.
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-10T18:59:49Z.
@QRMOE opened as #2967 with your four commits from
ade10c77rebased ontomain9c5d67fb, your authorship kept and you credited in the description. Both tests pass 5/5 on Linux and Windows, and all six titles get pastutimeon both. Capy Mobile now resolves every import and on Windows gets as far as creating its swapchain before stopping atkern.sdk_version(#2701).Pull request closed