feat(libkernel_sys): implement pathconf #4503

Closed
jagrat04 wants to merge 1 commit from upstream-pr/4503 into main
jagrat04 commented 2026-10-12 13:45:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jagrat04 on 2026-10-12T13:45:10Z.


What

Fixes #3502.

Carries screamm@d93d0e588 rebased onto main. libkernel_sys does not export pathconf (NID oc98+zOImus), which causes Porpoise 2.7 (PPSA99764) to fail to load on main.

Implements pathconf following FreeBSD 11 kern_pathconf and UFS ufs_pathconf constants. Links are followed, path >= 1024 bytes or component > 255 fails with ENAMETOOLONG, missing path with ENOENT. Unsupported/kernel-dependent options throw or fail with EINVAL, and technical debt is documented in TechnicalDebt.md.

Tested

  • Windows 11 host. Porpoise 2.7 (PPSA99764) load stop resolved.
  • Added test coverage in core/libs/tests/GuestKernelSys.cpp checking valid pathconf queries, error codes, and name limits.
  • python tools/check_conventions.py --base origin/main passed cleanly with 0 errors.

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:4830299568 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4503). Originally posted by [jagrat04](https://github.com/jagrat04) on 2026-10-12T13:45:10Z. --- ### What Fixes #3502. Carries screamm@d93d0e588 rebased onto `main`. `libkernel_sys` does not export `pathconf` (NID `oc98+zOImus`), which causes Porpoise 2.7 (PPSA99764) to fail to load on `main`. Implements `pathconf` following FreeBSD 11 `kern_pathconf` and UFS `ufs_pathconf` constants. Links are followed, path >= 1024 bytes or component > 255 fails with `ENAMETOOLONG`, missing path with `ENOENT`. Unsupported/kernel-dependent options throw or fail with `EINVAL`, and technical debt is documented in `TechnicalDebt.md`. ### Tested - Windows 11 host. Porpoise 2.7 (PPSA99764) load stop resolved. - Added test coverage in `core/libs/tests/GuestKernelSys.cpp` checking valid pathconf queries, error codes, and name limits. - `python tools/check_conventions.py --base origin/main` passed cleanly with 0 errors. ### 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
fma-rc commented 2026-10-12 13:46:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-12T13:46:34Z.


@jagrat04 Please use the PR template here and in other PRs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6125556600 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4503#issuecomment-6125556600). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-12T13:46:34Z. --- @jagrat04 Please use the [PR template](https://github.com/boykopovar/AnyPS5/blob/main/.github/pull_request_template.md) here and in other PRs.
jagrat04 commented 2026-10-12 13:51:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jagrat04 on 2026-10-12T13:51:55Z.


@fma-rc ok, sorry forgot

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6125655720 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4503#issuecomment-6125655720). Originally posted by [jagrat04](https://github.com/jagrat04) on 2026-10-12T13:51:55Z. --- @fma-rc ok, sorry forgot
github-actions[bot] commented 2026-10-12 13:59:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T13:59:28Z.


Progress report (682ef0c → dad7f9e)

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

✅ 1 implemented
Library Name
libkernel_sys pathconf_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6125796511 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4503#issuecomment-6125796511). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T13:59:28Z. --- <!-- progress-report --> ### Progress report (682ef0c → dad7f9e) 📈 **System libraries**: 86.37% (+0.01%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libkernel_sys | `pathconf_nid_postfix` | </details>
Nixitov commented 2026-10-12 16:46:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Nixitov on 2026-10-12T16:46:50Z.


Verified on Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release: the branch builds (patched libkernel_sys.prx).

  • OutRun2006 (PPSA99106): on main it stops at FAIL: unresolved ELF import oc98+zOImus (pathconf) from libkernel_sys.prx; with this change it passes pathconf and stops at 6n23e0gIJ9s (nearbyintl).
  • Porpoise (PPSA99764): on main it stops at oc98+zOImus (pathconf); with this change it stops at AKknh8Cx-V8 (chroot).

Note: #3611 implements pathconf too and is CONFLICTING; this one is the clean branch.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128627067 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4503#issuecomment-6128627067). Originally posted by [Nixitov](https://github.com/Nixitov) on 2026-10-12T16:46:50Z. --- Verified on **Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release**: the branch builds (patched `libkernel_sys.prx`). - **OutRun2006 (PPSA99106):** on `main` it stops at `FAIL: unresolved ELF import oc98+zOImus (pathconf) from libkernel_sys.prx`; with this change it passes `pathconf` and stops at `6n23e0gIJ9s` (`nearbyintl`). - **Porpoise (PPSA99764):** on `main` it stops at `oc98+zOImus` (`pathconf`); with this change it stops at `AKknh8Cx-V8` (`chroot`). Note: **#3611 implements `pathconf` too and is `CONFLICTING`**; this one is the clean branch. AI-assisted: yes
jagrat04 commented 2026-10-12 23:02:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jagrat04 on 2026-10-12T23:02:34Z.


Closing as pathconf has already been merged into main via #3611.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6134278843 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4503#issuecomment-6134278843). Originally posted by [jagrat04](https://github.com/jagrat04) on 2026-10-12T23:02:34Z. --- Closing as pathconf has already been merged into main via #3611.

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