feat(libkernel): export pthread_attr_getstackaddr #3729

Closed
Mouad-Scriptz-0 wants to merge 1 commit from upstream-pr/3729 into main
Mouad-Scriptz-0 commented 2026-10-11 16:07:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Mouad-Scriptz-0 on 2026-10-11T16:07:08Z.


What

Exports the POSIX pthread_attr_getstackaddr (DxmIMUQ-wXY) from libkernel, next to pthread_attr_getstack. It returns the attribute's stackAddress and EINVAL for a null or destroyed attribute or a null output, as FreeBSD libthr's _pthread_attr_getstackaddr does; a fresh attribute reports a null address. guest_pthread_attr covers the address set by pthread_attr_setstack, the null default, both null arguments and a destroyed attribute.

On main it is an absent import of 13 catalog titles (table in #3488); for XashPS5, ccleste, RommPS, ProsperoLight, vkQuake and PSBox Cloud Gaming the four pthread_attr_* functions are the only absent imports left, so with #3165 they load with zero. Closes #3488.

Tested

Fedora 44 (kernel 7.2.8, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON), commit 1d2cb8c5 on main 0f863c10: guest_pthread_attr 3/3 (--repeat until-fail:3), ctest -j6 -E "^agc_driver_" 534/534, tools/check_conventions.py --base origin/main and git diff --check pass. This head is the same commit rebased onto main a11c8f7f (clean); @blawesom verified that rebase on CachyOS / RADV with the full suite at 832/832 (comment). Import audit: catalog ZIPs checked against their sha256, eboot.bin and modules unwrapped, relinker --registry, tools/import_audit.py against .prx built from main and from the branch; the one import that disappears in every title is DxmIMUQ-wXY. The titles were not run. Not tested on Windows.

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 (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4820412844 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3729). Originally posted by [Mouad-Scriptz-0](https://github.com/Mouad-Scriptz-0) on 2026-10-11T16:07:08Z. --- ### What Exports the POSIX `pthread_attr_getstackaddr` (`DxmIMUQ-wXY`) from libkernel, next to `pthread_attr_getstack`. It returns the attribute's `stackAddress` and `EINVAL` for a null or destroyed attribute or a null output, as FreeBSD libthr's `_pthread_attr_getstackaddr` does; a fresh attribute reports a null address. `guest_pthread_attr` covers the address set by `pthread_attr_setstack`, the null default, both null arguments and a destroyed attribute. On `main` it is an absent import of 13 catalog titles (table in #3488); for XashPS5, ccleste, RommPS, ProsperoLight, vkQuake and PSBox Cloud Gaming the four `pthread_attr_*` functions are the only absent imports left, so with #3165 they load with zero. Closes #3488. ### Tested Fedora 44 (kernel 7.2.8, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`), commit `1d2cb8c5` on `main` 0f863c10: `guest_pthread_attr` 3/3 (`--repeat until-fail:3`), `ctest -j6 -E "^agc_driver_"` 534/534, `tools/check_conventions.py --base origin/main` and `git diff --check` pass. This head is the same commit rebased onto `main` a11c8f7f (clean); @blawesom verified that rebase on CachyOS / RADV with the full suite at 832/832 ([comment](https://github.com/boykopovar/AnyPS5/issues/3488#issuecomment-6109353522)). Import audit: catalog ZIPs checked against their sha256, `eboot.bin` and modules unwrapped, `relinker --registry`, `tools/import_audit.py` against `.prx` built from `main` and from the branch; the one import that disappears in every title is `DxmIMUQ-wXY`. The titles were not run. Not tested on Windows. ### 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 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 (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-11 16:08:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T16:08:32Z.


Progress report (a11c8f7 → df73629)

📈 System libraries: 85.82% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libkernel pthread_attr_getstackaddr_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110964622 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3729#issuecomment-6110964622). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T16:08:32Z. --- <!-- progress-report --> ### Progress report (a11c8f7 → df73629) 📈 **System libraries**: 85.82% (+0.01%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libkernel | `pthread_attr_getstackaddr_nid_postfix` | </details>
adriadam10 commented 2026-10-11 16:10:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T16:10:31Z.


Thanks for the PR. The change itself looks right: it matches FreeBSD libthr's _pthread_attr_getstackaddr (EINVAL on a null/destroyed attribute or null output), the test fails without it, and the build and ctest pass here.

Closing because #3494 (opened earlier today) already implements the same export, pthread_attr_getstackaddr, in the same file with a test in GuestPthreadAttr.cpp, together with pthread_attr_getscope/setscope/getinheritsched. The CONTRIBUTING rule is that no open PR implements the same functions, and the overlap here is the whole PR, so it can't be trimmed down.

Feel free to reopen if #3494 drops pthread_attr_getstackaddr or is closed; please review its version meanwhile, and the title evidence you collected in #3488 is useful there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110983334 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3729#issuecomment-6110983334). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T16:10:31Z. --- Thanks for the PR. The change itself looks right: it matches FreeBSD libthr's `_pthread_attr_getstackaddr` (EINVAL on a null/destroyed attribute or null output), the test fails without it, and the build and ctest pass here. Closing because #3494 (opened earlier today) already implements the same export, `pthread_attr_getstackaddr`, in the same file with a test in `GuestPthreadAttr.cpp`, together with `pthread_attr_getscope`/`setscope`/`getinheritsched`. The CONTRIBUTING rule is that no open PR implements the same functions, and the overlap here is the whole PR, so it can't be trimmed down. Feel free to reopen if #3494 drops `pthread_attr_getstackaddr` or is closed; please review its version meanwhile, and the title evidence you collected in #3488 is useful there.

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