feat(libSceLibcInternal): implement guest utime #2967

Merged
babyhuey merged 4 commits from upstream-pr/2967 into main 2026-10-10 22:03:20 +00:00
babyhuey commented 2026-10-10 18:59:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-10T18:59:45Z.


What

Implements utime (1nTKA7pN1jw) in libSceLibcInternal. All four commits are @QRMOE's, from #2024 (their corrected revision ade10c77, rebased onto main with their authorship kept). They can't open PRs yet because of the intake check and asked me to open it.

It converts the guest's two 64-bit seconds fields to zero-microsecond timevals and forwards through the existing guest utimes path; null times request the current clock (FreeBSD utime). The caller's guest errno is kept on success and the delegated error is kept on failure, since guest errno shares host errno storage. guest_utime_forwarding links the wrapper with a backend that changes errno on success and checks explicit and null times, 64-bit seconds, zero fractions, the return value, one backend call and failure errno.

Six catalog titles stop at it on main 9c5d67fb (catalog builds, eboot.bin and sce_module/libc.prx unwrapped as #2605 requires; tracked in #1578). main, Windows: FAIL: unresolved ELF import 1nTKA7pN1jw (utime) from libSceLibcInternal.prx; Linux: undefined symbol: 1nTKA7pN1jw.

Title with this PR (Linux)
ccleste (PPSA59322) 04AjkP0jO9U (_umtx_op, #1482)
RommPS (PPSA76677) 04AjkP0jO9U (_umtx_op)
Capy Mobile (PPSA92280) no missing import; on Linux it runs until DisplayWindow finds no Vulkan display in the headless test container (Windows below)
PSXS5 (PPSA97510) oxMp8uPqa+U (pthread_set_name_np, #1872)
SwanStationPS5 (PPSA98510) oxMp8uPqa+U (pthread_set_name_np)
vkQuake (PPSA99010) 04AjkP0jO9U (_umtx_op)

Tested

Linux (Ubuntu 24.04, GCC 13, Release) on 9c5d67fb: guest_utime and guest_utime_forwarding pass 5/5 (--repeat until-fail:5), and the title results above. check_conventions.py passes. Windows 11 (MinGW-w64 GCC 15.2 from WinLibs, Release) on the same commit: both tests 5/5 with no warnings, and the same stops for ccleste, RommPS, PSXS5, SwanStationPS5 and vkQuake (for example FAIL: unresolved ELF import 04AjkP0jO9U (_umtx_op) from libkernel.prx). On Windows, Capy Mobile resolves every import, creates its Vulkan surface and swapchain, opens /app0/saves/.probe and then stops at sysctlbyname_nid_postfix: unsupported name kern.sdk_version (#2701, #2697).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4813680445 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2967). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-10T18:59:45Z. --- ### What Implements `utime` (`1nTKA7pN1jw`) in libSceLibcInternal. All four commits are @QRMOE's, from #2024 (their corrected revision ade10c77, rebased onto `main` with their authorship kept). They can't open PRs yet because of the intake check and asked me to open it. It converts the guest's two 64-bit seconds fields to zero-microsecond timevals and forwards through the existing guest `utimes` path; null times request the current clock ([FreeBSD utime](https://github.com/freebsd/freebsd-src/blob/main/lib/libc/gen/utime.c)). The caller's guest errno is kept on success and the delegated error is kept on failure, since guest errno shares host errno storage. `guest_utime_forwarding` links the wrapper with a backend that changes errno on success and checks explicit and null times, 64-bit seconds, zero fractions, the return value, one backend call and failure errno. Six catalog titles stop at it on `main` 9c5d67fb (catalog builds, `eboot.bin` and `sce_module/libc.prx` unwrapped as #2605 requires; tracked in #1578). `main`, Windows: `FAIL: unresolved ELF import 1nTKA7pN1jw (utime) from libSceLibcInternal.prx`; Linux: `undefined symbol: 1nTKA7pN1jw`. | Title | with this PR (Linux) | |---|---| | ccleste (PPSA59322) | `04AjkP0jO9U` (`_umtx_op`, #1482) | | RommPS (PPSA76677) | `04AjkP0jO9U` (`_umtx_op`) | | Capy Mobile (PPSA92280) | no missing import; on Linux it runs until `DisplayWindow` finds no Vulkan display in the headless test container (Windows below) | | PSXS5 (PPSA97510) | `oxMp8uPqa+U` (`pthread_set_name_np`, #1872) | | SwanStationPS5 (PPSA98510) | `oxMp8uPqa+U` (`pthread_set_name_np`) | | vkQuake (PPSA99010) | `04AjkP0jO9U` (`_umtx_op`) | ### Tested Linux (Ubuntu 24.04, GCC 13, Release) on 9c5d67fb: `guest_utime` and `guest_utime_forwarding` pass 5/5 (`--repeat until-fail:5`), and the title results above. `check_conventions.py` passes. Windows 11 (MinGW-w64 GCC 15.2 from WinLibs, Release) on the same commit: both tests 5/5 with no warnings, and the same stops for ccleste, RommPS, PSXS5, SwanStationPS5 and vkQuake (for example `FAIL: unresolved ELF import 04AjkP0jO9U (_umtx_op) from libkernel.prx`). On Windows, Capy Mobile resolves every import, creates its Vulkan surface and swapchain, opens `/app0/saves/.probe` and then stops at `sysctlbyname_nid_postfix: unsupported name kern.sdk_version` (#2701, #2697). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-10 19:23:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T19:23:16Z.


Progress report (4a747c4 → 71ff607)

➖ System libraries: 84.48% (+0.0%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceLibcInternal utime_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101280721 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2967#issuecomment-6101280721). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T19:23:16Z. --- <!-- progress-report --> ### Progress report (4a747c4 → 71ff607) ➖ **System libraries**: 84.48% (+0.0%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceLibcInternal | `utime_nid_postfix` | </details>
adriadam10 commented 2026-10-10 22:03:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T22:03:17Z.


Checked on Linux merged onto current main: guest_utime and guest_utime_forwarding pass 5/5, the rest of the libSceLibcInternal/libs ctest scope is green, utimes is the existing libkernel one, no duplicate export, and the tests cover explicit and null times, 64-bit seconds, errno kept on success and delegated on failure. Merging. Thanks @babyhuey, and @QRMOE for the original work.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102653007 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2967#issuecomment-6102653007). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T22:03:17Z. --- Checked on Linux merged onto current `main`: `guest_utime` and `guest_utime_forwarding` pass 5/5, the rest of the libSceLibcInternal/libs ctest scope is green, `utimes` is the existing libkernel one, no duplicate export, and the tests cover explicit and null times, 64-bit seconds, errno kept on success and delegated on failure. Merging. Thanks @babyhuey, and @QRMOE for the original work.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2967
No description provided.