feat(libSceLibcInternal): implement getopt and getopt_long #3694
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3694"
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 MarcZX10 on 2026-10-11T15:32:02Z.
What
Carries David's ready implementation from issue #3562, preserving the original commit and authorship. Exports
getopt,getopt_long, and the five guest state variables fromlibSceLibcInternal.The implementation follows FreeBSD 11.4
getoptandgetopt_longbehavior, including GNU-compatible permutation,POSIXLY_CORRECT,+and-prefixes,W;,optind = 0reset, long-option abbreviations, and gueststderrdiagnostics.getopt_long_onlyis not part of the issue and is not included. The issue identifies predicted import failures for XPSemu and RetroArch; neither has been observed in a title run.Tested
guest_getopt_tests; CTestguest_getoptpassed 1/1.python3 tools/check_conventions.py --base upstream/main --head ac55111f7passed.git diff --check upstream/main...ac55111f7passed.guest_getoptand a broad suite on the original ready branch. I have not independently run Windows or a title.Checklist
main; no other open PR implements these functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T15:32:23Z.
Progress report (
1acfa7f→1d67426)📈 System libraries: 86.37% (+0.01%, +2 implemented functions)
✅ 2 implemented
getopt_long_nid_postfixgetopt_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T22:01:37Z.
Rebased onto current main (only conflict: an adjacent TechnicalDebt line, both kept). Rebuilt and ran the libSceLibcInternal and libs tests: 29/29 pass, including
guest_getopt. Logic checked earlier against FreeBSD 11getopt.c/getopt_long.c; merging once CI is green.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T22:17:56Z.
Rebased the getopt implementation onto current main after the eligibility check found it no longer merged cleanly following #3858. The CMake conflict was resolved by retaining both the newly merged Windows TLS-destructor test setup and the getopt test registration. The commit author remains David. Linux GCC 12.2 Release build succeeded; guest_getopt and guest_force_tls_destructor passed (2/2). The conventions checker and git diff --check pass. Fresh GitHub checks are pending.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T20:03:40Z.
Re-checked the new head (your rebase, same patch as the one we reviewed):
guest_getoptpasses on current main, conventions and eligibility are green. Logic was checked against FreeBSD 11getopt.c/getopt_long.c; merging.