feat(libc): implement getprogname #1869

Closed
TheAggie wants to merge 1 commit from upstream-pr/1869 into main
TheAggie commented 2026-10-08 22:27:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-08T22:27:43Z.


What

getprogname was not exported. ccleste (PPSA59322) and the BlackBearReloaded OpenGL homebrew apps (UI Lab PPSA99050, OpenGL Showcase PPSA99005, Puzzles PPSA99006) import it.

It returns "eboot.bin", the same name libkernel already exports as __progname, so the two agree.

  • core/libs/prx/libSceLibcInternal/Export.cpp: getprogname.
  • guest_thread_atexit test: it returns "eboot.bin".

Tested

Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release.

  • The full suite (485 tests) passes on current main with this PR and four other small libc/libkernel PRs of mine merged together (atol, getprogname, dup2, ctime/rewind, pthread_set_name_np). It was run from the generated CTestTestfile.cmake commands because antivirus blocks ctest.exe on this machine.
  • tools/check_conventions.py --base origin/main passes on this branch alone.

Not tested on Linux or macOS.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4793542471 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1869). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-08T22:27:43Z. --- ### What `getprogname` was not exported. ccleste (PPSA59322) and the BlackBearReloaded OpenGL homebrew apps (UI Lab PPSA99050, OpenGL Showcase PPSA99005, Puzzles PPSA99006) import it. It returns `"eboot.bin"`, the same name libkernel already exports as `__progname`, so the two agree. - `core/libs/prx/libSceLibcInternal/Export.cpp`: `getprogname`. - `guest_thread_atexit` test: it returns `"eboot.bin"`. ### Tested Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. - The full suite (485 tests) passes on current `main` with this PR and four other small libc/libkernel PRs of mine merged together (atol, getprogname, dup2, ctime/rewind, pthread_set_name_np). It was run from the generated `CTestTestfile.cmake` commands because antivirus blocks `ctest.exe` on this machine. - `tools/check_conventions.py --base origin/main` passes on this branch alone. Not tested on Linux or macOS. ### 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 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-08 22:29:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T22:29:21Z.


Progress report (ce64d8e → 104050b)

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

✅ 1 implemented
Library Name
libSceLibcInternal getprogname_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6070336675 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1869#issuecomment-6070336675). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T22:29:21Z. --- <!-- progress-report --> ### Progress report (ce64d8e → 104050b) ➖ **System libraries**: 84.76% (+0.0%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceLibcInternal | `getprogname_nid_postfix` | </details>
github-actions[bot] commented 2026-10-08 22:30:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T22:30:07Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#1852 core/libs/prx/libSceLibcInternal/Export.cpp L106
#1906 core/libs/prx/libSceLibcInternal/Export.cpp L106
core/libs/tests/GuestThreadAtexit.cpp L12, L58
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6070349376 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1869#issuecomment-6070349376). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T22:30:07Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #1852 | `core/libs/prx/libSceLibcInternal/Export.cpp` [L106](https://github.com/boykopovar/AnyPS5/blob/d9484c719b2a5ac6201e27f8657e0fb0f01e648c/core/libs/prx/libSceLibcInternal/Export.cpp#L106) | | | | #1906 | `core/libs/prx/libSceLibcInternal/Export.cpp` [L106](https://github.com/boykopovar/AnyPS5/blob/d9484c719b2a5ac6201e27f8657e0fb0f01e648c/core/libs/prx/libSceLibcInternal/Export.cpp#L106)<br>`core/libs/tests/GuestThreadAtexit.cpp` [L12](https://github.com/boykopovar/AnyPS5/blob/d9484c719b2a5ac6201e27f8657e0fb0f01e648c/core/libs/tests/GuestThreadAtexit.cpp#L12), [L58](https://github.com/boykopovar/AnyPS5/blob/d9484c719b2a5ac6201e27f8657e0fb0f01e648c/core/libs/tests/GuestThreadAtexit.cpp#L58) | | |
Dextroid17 commented 2026-10-09 02:46:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-09T02:46:38Z.

Review: COMMENTED


Verified on Linux — the differential holds, which is the half the "Tested" line could not cover.

  • Arm A (this PR): cmake --build build --target guest_thread_atexit_tests --parallel 16 → clean; the binary runs and passes, exit 0.
  • Arm B (control): the implementation file back at main with the new test kept → the target fails to link:
GuestThreadAtexit.cpp:(.text.startup+0x1e): undefined reference to `getprogname_nid_postfix'

So the test cannot even run without the export, and its behavioural assertions are what carry the rest.

Claim cross-check: getprogname returns "eboot.bin" (Export.cpp:108) and libkernel defines __progname_nid_postfix = "eboot.bin" (libkernel/System/src/Process.cpp:116), so the two do agree, as the body says.

The titles are named (ccleste PPSA59322; UI Lab PPSA99050, OpenGL Showcase PPSA99005, Puzzles PPSA99006) — that is exactly the part reviewers ask for, and it is here.

Not verified: Windows (the author's platform), and behaviour beyond what this test asserts.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5465145185 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1869#pullrequestreview-5465145185). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-09T02:46:38Z. **Review:** COMMENTED --- Verified on Linux — the differential holds, which is the half the "Tested" line could not cover. - **Arm A (this PR)**: `cmake --build build --target guest_thread_atexit_tests --parallel 16` → clean; the binary runs and passes, **exit 0**. - **Arm B (control)**: the implementation file back at `main` with the new test kept → the target **fails to link**: ``` GuestThreadAtexit.cpp:(.text.startup+0x1e): undefined reference to `getprogname_nid_postfix' ``` So the test cannot even run without the export, and its behavioural assertions are what carry the rest. **Claim cross-check**: `getprogname` returns `"eboot.bin"` (`Export.cpp:108`) and libkernel defines `__progname_nid_postfix = "eboot.bin"` (`libkernel/System/src/Process.cpp:116`), so the two do agree, as the body says. The titles are named (ccleste PPSA59322; UI Lab PPSA99050, OpenGL Showcase PPSA99005, Puzzles PPSA99006) — that is exactly the part reviewers ask for, and it is here. Not verified: Windows (the author's platform), and behaviour beyond what this test asserts. Written with AI assistance.
oneandonlydean commented 2026-10-09 09:30:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:30:17Z.


Closing: none of the titles that import getprogname stops at it on main: ccleste stops at shm_open, PPSA99005 and PPSA99006 at mkstemp, PPSA99050 at sceVideoOutGetResolutionStatus. Reopen when it's a title's next stop on main, with the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6078238798 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1869#issuecomment-6078238798). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T09:30:17Z. --- Closing: none of the titles that import `getprogname` stops at it on main: ccleste stops at `shm_open`, PPSA99005 and PPSA99006 at `mkstemp`, PPSA99050 at `sceVideoOutGetResolutionStatus`. Reopen when it's a title's next stop on main, with the log line.
babyhuey commented 2026-10-11 06:35:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-11T06:35:56Z.


@TheAggie getprogname is now the next stop for three catalog titles on main 52ce9b8a (Linux, catalog builds with sce_module/libc.prx unwrapped as #2605 requires), each with app.elf: symbol lookup error: app.elf: undefined symbol: 7Psx1DlAyE4:

  • Yamagi Quake II (PPSA99007)
  • PS5MC (PPSA99420)
  • Emby5 (PPSA99515)

This head (104050b4) merges cleanly onto 52ce9b8a and guest_thread_atexit passes 5/5 (--repeat until-fail:5). With it, PS5MC and Emby5 go on to setcontext (2VRU7xiqLO8), and Yamagi gets past it and aborts later without a log line in my headless run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106298772 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1869#issuecomment-6106298772). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-11T06:35:56Z. --- @TheAggie `getprogname` is now the next stop for three catalog titles on `main` 52ce9b8a (Linux, catalog builds with `sce_module/libc.prx` unwrapped as #2605 requires), each with `app.elf: symbol lookup error: app.elf: undefined symbol: 7Psx1DlAyE4`: - Yamagi Quake II (PPSA99007) - PS5MC (PPSA99420) - Emby5 (PPSA99515) This head (104050b4) merges cleanly onto 52ce9b8a and `guest_thread_atexit` passes 5/5 (`--repeat until-fail:5`). With it, PS5MC and Emby5 go on to `setcontext` (`2VRU7xiqLO8`), and Yamagi gets past it and aborts later without a log line in my headless run.

Pull request closed

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!1869
No description provided.