feat(libSceLibcInternal): implement setprogname #12896

Merged
heditrigui merged 1 commit from upstream-pr/12896 into main 2026-11-05 08:51:00 +00:00
heditrigui commented 2026-10-29 13:44:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by heditrigui on 2026-10-29T13:44:05Z.


What

Implement setprogname (NID thsdReD7DNc) in libSceLibcInternal:

  • Implements FreeBSD 11.4 lib/libc/gen/setprogname.c semantics setting __progname_nid_postfix.
  • Finds the last '/' separator to strip leading path directory prefixes (e.g. '/app0/eboot.bin' -> 'eboot.bin').
  • Throws std::invalid_argument when passed a null pointer per project conventions.
  • Adds comprehensive unit test assertions in GuestProgramName.cpp verifying full path stripping, direct name assignment, empty string handling, null name exception, and errno preservation.
  • Documents technical debt note in docs/dev/debt/libSceLibcInternal.md.

Tested

Ran python tools/check_conventions.py --base upstream/main cleanly (0 errors).
Ran python core/libs/tests/test_public_headers.py --audit-only cleanly (373 libraries, 13950 exports verified).
Ran python tools/progress.py --module libSceLibcInternal verifying implementation count increase (libraries 72/76 -> 73/76).

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5069136610 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12896). Originally posted by [heditrigui](https://github.com/heditrigui) on 2026-10-29T13:44:05Z. --- ### What Implement setprogname (NID thsdReD7DNc) in libSceLibcInternal: - Implements FreeBSD 11.4 lib/libc/gen/setprogname.c semantics setting __progname_nid_postfix. - Finds the last '/' separator to strip leading path directory prefixes (e.g. '/app0/eboot.bin' -> 'eboot.bin'). - Throws std::invalid_argument when passed a null pointer per project conventions. - Adds comprehensive unit test assertions in GuestProgramName.cpp verifying full path stripping, direct name assignment, empty string handling, null name exception, and errno preservation. - Documents technical debt note in docs/dev/debt/libSceLibcInternal.md. ### Tested Ran python tools/check_conventions.py --base upstream/main cleanly (0 errors). Ran python core/libs/tests/test_public_headers.py --audit-only cleanly (373 libraries, 13950 exports verified). Ran python tools/progress.py --module libSceLibcInternal verifying implementation count increase (libraries 72/76 -> 73/76). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
CnRJay commented 2026-11-01 19:54:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:54:18Z.

Review: COMMENTED


Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (Unblocks: none is allowed), and it contained no code review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729937883 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12896#pullrequestreview-5729937883). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:54:18Z. **Review:** COMMENTED --- Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (`Unblocks: none` is allowed), and it contained no code review.
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!12896
No description provided.