feat(libc): implement strtofflags #27243
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27243"
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 gnavarro24 on 2026-11-25T15:20:48Z.
What
Adds
strtofflags, which parses a list of file flag names (for exampleuchg,hidden) into set and clear masks, as FreeBSD 11.4 does. Words are separated by tab, space or comma. Flag values come from FreeBSD'ssys/sys/stat.hat the pinned commit. The FreeBSD license notice stays at the top of the file, and the debt fragment citesstrtofflags.cat the pinned commit.setmodeandfflagstostrare not in this PR.Tested
Not tested on this host: libc does not link on the macOS machine used for this change, because current main's
exception/Runtime.cppuses__class_type_infomembers that the Apple SDK lacks. Checked here: conventions,check_conventions.py, syntax of the changed files, and the expected values of the test against a Python transcription of FreeBSD's algorithm and flag table. CI builds and runs the new test.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T15:32:07Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the parser behavior and its test setup look consistent with the stated goal.
What I ran
Reviewed head
f4d7aafa4138fe569c0fc70d68495fa5693dd19f. No build or tests were run; the description reports CI runs the new test, but I did not verify that result.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No build or test execution, FreeBSD parity run, or console behavior was verified. Read:
core/libs/prx/libc/CMakeLists.txt,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/src/StatFlags.cpp,core/libs/prx/libc/tests/cmake/guest_libc_strtofflags.cmake,core/libs/tests/GuestLibcStrtofflags.cpp, anddocs/dev/debt/changes/feat-libc-strtofflags.md. No changed files were excluded; the manifest lists all six as included.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by fromthemoonx on 2026-11-25T18:40:27Z.
Review: APPROVED
Windows build and test run, since libc doesn't link on your macOS host and CI is still queued:
main1afab89d42; headf4d7aafa41merged on top.guest_libc_strtofflagspasses, then 10/10 repeats pass.flush()beforereturn 1, and dropping the*stringpwrite-back in the loop. Both makeguest_libc_strtofflagsfail.tools/debt_fold.py --checkandtools/check_conventions.py --base 1afab89d42pass on the merge.I also compared
strtofflags_nid_postfixwith FreeBSD'sstrtofflags.c: both outputs zeroed first,*stringpleft at the last token (or at the unknown one), flags set before an unknown token kept, andnodumpas the only inverted entry. I found no differences.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T17:37:16Z.
Review: COMMENTED
Actionable comments posted: 2
8833eae7-f8db-48ab-a88b-d81a7394edfdReviewing files that changed from the base of the PR and between
2d8e4b5ccfand68883c004c.core/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/include/Api.hppcore/libs/prx/libc/src/StatFlags.cppcore/libs/prx/libc/tests/cmake/guest_libc_strtofflags.cmakecore/libs/tests/GuestLibcStrtofflags.cppdocs/dev/debt/changes/feat-libc-strtofflags.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T01:26:29Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and its included tests cover the advertised parsing behavior, and the code read showed no verified blocking defect.
What I ran
Reviewed head
240b92fe94060ba3ee104952144c23fd80d4bb16using the prepared diff andrepo_read.py. No build or test command was run; the PR description reports CI ran the new test, but that was not independently verified here.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests were run in this review. The full text of all six changed files listed in the manifest was read:
core/libs/prx/libc/CMakeLists.txt,core/libs/prx/libc/include/Api.hpp,core/libs/prx/libc/src/StatFlags.cpp,core/libs/prx/libc/tests/cmake/guest_libc_strtofflags.cmake,core/libs/tests/GuestLibcStrtofflags.cpp, anddocs/dev/debt/changes/feat-libc-strtofflags.md. The manifest marks all six as included; no changed files were excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by GalaxyGamingFR on 2026-11-30T23:34:40Z.
Review: APPROVED
Verified on Linux (Ubuntu 26.04.1, GCC 15.2.0, Ninja, Release). I merged head
92319625b4into currentmaintogether with #27565, #27243 and #27682 (no conflicts between them).ninja core/libs/prx/libc/all core/libs/prx/libSceLibcInternal/all) built cleanly.guest_environment_binding_unloadskipped as on main. The full libSceLibcInternal set passed, 134/134.guest_libc_strtofflagspassed.No problems found.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T08:51:49Z.
Review: COMMENTED
The Linux
GuestLibcStrtofflagsfixture passed with the exact implementation. It includes set and clear masks, aliased outputs, continuation at the first unrecognized token, and calls where either result mask is omitted.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T12:36:57Z.
Review: APPROVED
I read the diff at
92319625b4. Windows 11 with GCC 15.2 and Linux (Ubuntu 24.04 in WSL2, GCC 13.3), merged intomainatdaa61711afetogether with other open PRs (so not an isolated build).guest_libc_strtofflags: pass on both.strtofflagsis a new export, so the test cannot run without it.Not checked: a console.
AI-assisted: yes (Claude Code)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.