feat(libkernel): implement pthread_rwlockattr_init and pthread_rwlockattr_destroy #2973

Merged
babyhuey merged 1 commit from upstream-pr/2973 into main 2026-10-10 21:53:36 +00:00
babyhuey commented 2026-10-10 19:08:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-10T19:08:26Z.


What

Implements pthread_rwlockattr_init (xFebsA4YsFI) and pthread_rwlockattr_destroy in libkernel as POSIX wrappers over the existing scePthreadRwlockattrInit and scePthreadRwlockattrDestroy, returning errno values through toPosix like the other pthread_rwlock* wrappers.

OpenNOW PS5 (PPSA99082) stops at it on main 4a747c48, now that cpuset_getaffinity (#2859) is in (catalog build, eboot.bin and sce_module/libc.prx unwrapped as #2605 requires; tracked in #1578):

  • main, Linux: app.elf: symbol lookup error: app.elf: undefined symbol: xFebsA4YsFI
  • with this PR, Linux: app.elf: symbol lookup error: app.elf: undefined symbol: oxMp8uPqa+U (pthread_set_name_np, #1872)
  • with this PR, Windows: FAIL: unresolved ELF import oxMp8uPqa+U (pthread_set_name_np) from libkernel.prx

Tested

Linux (Ubuntu 24.04, GCC 13, Release) on 4a747c48: guest_pthread_rwlock passes 5/5 (--repeat until-fail:5). The new case creates an attribute object, initialises a lock with it, checks that a reader is refused while a writer holds it, and destroys both. check_conventions.py passes. Windows 11 (MinGW-w64 GCC 15.2 from WinLibs, Release): guest_pthread_rwlock 5/5 and the OpenNOW line above, on the same commit stacked on cpuset_getaffinity before #2859 merged.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4813734426 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2973). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-10T19:08:26Z. --- ### What Implements `pthread_rwlockattr_init` (`xFebsA4YsFI`) and `pthread_rwlockattr_destroy` in libkernel as POSIX wrappers over the existing `scePthreadRwlockattrInit` and `scePthreadRwlockattrDestroy`, returning errno values through `toPosix` like the other `pthread_rwlock*` wrappers. OpenNOW PS5 (PPSA99082) stops at it on `main` 4a747c48, now that `cpuset_getaffinity` (#2859) is in (catalog build, `eboot.bin` and `sce_module/libc.prx` unwrapped as #2605 requires; tracked in #1578): - `main`, Linux: `app.elf: symbol lookup error: app.elf: undefined symbol: xFebsA4YsFI` - with this PR, Linux: `app.elf: symbol lookup error: app.elf: undefined symbol: oxMp8uPqa+U` (`pthread_set_name_np`, #1872) - with this PR, Windows: `FAIL: unresolved ELF import oxMp8uPqa+U (pthread_set_name_np) from libkernel.prx` ### Tested Linux (Ubuntu 24.04, GCC 13, Release) on 4a747c48: `guest_pthread_rwlock` passes 5/5 (`--repeat until-fail:5`). The new case creates an attribute object, initialises a lock with it, checks that a reader is refused while a writer holds it, and destroys both. `check_conventions.py` passes. Windows 11 (MinGW-w64 GCC 15.2 from WinLibs, Release): `guest_pthread_rwlock` 5/5 and the OpenNOW line above, on the same commit stacked on `cpuset_getaffinity` before #2859 merged. ### 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
github-actions[bot] commented 2026-10-10 19:23:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T19:23:25Z.


Progress report (4a747c4 → 5a43c9b)

📈 System libraries: 84.49% (+0.01%, +2 implemented functions)

✅ 2 implemented
Library Name
libkernel pthread_rwlockattr_destroy_nid_postfix
libkernel pthread_rwlockattr_init_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101282064 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2973#issuecomment-6101282064). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T19:23:25Z. --- <!-- progress-report --> ### Progress report (4a747c4 → 5a43c9b) 📈 **System libraries**: 84.49% (+0.01%, +2 implemented functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libkernel | `pthread_rwlockattr_destroy_nid_postfix` | | libkernel | `pthread_rwlockattr_init_nid_postfix` | </details>
adriadam10 commented 2026-10-10 21:53:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T21:53:34Z.


Checked the build and guest_pthread_rwlock on Linux; it passes with the change and fails to link without it. The wrappers follow the other pthread_rwlock* ones and no other open PR touches these functions. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102572186 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2973#issuecomment-6102572186). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T21:53:34Z. --- Checked the build and `guest_pthread_rwlock` on Linux; it passes with the change and fails to link without it. The wrappers follow the other `pthread_rwlock*` ones and no other open PR touches these functions. Merging once CI is green.
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!2973
No description provided.