libkernel_sys: pathconf is absent, first stop of Porpoise on main; fix branch ready #3502

Closed
opened 2026-10-11 12:00:24 +00:00 by screamm · 4 comments
screamm commented 2026-10-11 12:00:24 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T12:00:24Z.


libkernel_sys does not export pathconf (NID oc98+zOImus). On current main 0f863c10 Porpoise (PPSA99764) stops on it as its first stop (fresh Windows relink, --windows --registry unused-filter=0):

FAIL: unresolved ELF import oc98+zOImus from libkernel_sys.prx

Fix branch ready: screamm:feat/libkernel-pathconf (d93d0e58, one commit on main 0f863c10). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is. No PR exists for it (Amoenus mentioned a local placeholder in #1578 that was never pushed).

  • std::int64_t pathconf(const char* path, int name) in libkernel_sys/Export.cpp next to link/readlink, following FreeBSD 11.0 kern_pathconf/namei (671fb7df): the path is resolved first through the guest resolver, links followed, null EFAULT, empty or missing ENOENT, 1024 bytes or more and a component over 255 bytes ENAMETOOLONG (the latter only when the parent exists, as FreeBSD orders it). Values are FreeBSD 11 UFS ufs_pathconf constants (LINK_MAX 32767, NAME_MAX 255, PATH_MAX 1024, PIPE_BUF 512, CHOWN_RESTRICTED 1, NO_TRUNC 1, FILESIZEBITS 64, SYMLINK_MAX 1024, PRIO_IO 0, SYNC_IO 0, REC_MAX_XFER_SIZE -1 without errno). Names whose value depends on the mount, kernel options or page size (ALLOC_SIZE_MIN, REC_INCR/MIN_XFER_SIZE, MIN_HOLE_SIZE, the ACL and MAC names, REC_XFER_ALIGN) and the four where UFS and vop_stdpathconf disagree (MAX_CANON, MAX_INPUT, VDISABLE, ASYNC_IO) throw; every other name is EINVAL. TechnicalDebt records that the console's filesystem values (PFS on /app0) are unverified.
  • guest_kernel_sys gains every implemented name on a file and a directory, EINVAL names, the thirteen throwing names, ENOENT/EFAULT/ENAMETOOLONG cases.

Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including libs: guest_kernel_sys 3/3; ctest -j8 -E "^agc_driver_|^video_out_flip" 533/534, the one failure being windows_exceptions (#3411); with main's Export.cpp the extended test fails; tools/check_conventions.py --base main and git diff --check pass. Not run on Linux, no title run.

Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5800850132 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3502). Originally posted by [screamm](https://github.com/screamm) on 2026-10-11T12:00:24Z. --- libkernel_sys does not export `pathconf` (NID `oc98+zOImus`). On current `main` `0f863c10` Porpoise (PPSA99764) stops on it as its first stop (fresh Windows relink, `--windows --registry unused-filter=0`): ``` FAIL: unresolved ELF import oc98+zOImus from libkernel_sys.prx ``` **Fix branch ready:** [`screamm:feat/libkernel-pathconf`](https://github.com/screamm/AnyPS5/tree/feat/libkernel-pathconf) (`d93d0e58`, one commit on `main` `0f863c10`). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is. No PR exists for it (Amoenus mentioned a local placeholder in #1578 that was never pushed). - `std::int64_t pathconf(const char* path, int name)` in `libkernel_sys/Export.cpp` next to `link`/`readlink`, following FreeBSD 11.0 `kern_pathconf`/`namei` (`671fb7df`): the path is resolved first through the guest resolver, links followed, null `EFAULT`, empty or missing `ENOENT`, 1024 bytes or more and a component over 255 bytes `ENAMETOOLONG` (the latter only when the parent exists, as FreeBSD orders it). Values are FreeBSD 11 UFS `ufs_pathconf` constants (`LINK_MAX` 32767, `NAME_MAX` 255, `PATH_MAX` 1024, `PIPE_BUF` 512, `CHOWN_RESTRICTED` 1, `NO_TRUNC` 1, `FILESIZEBITS` 64, `SYMLINK_MAX` 1024, `PRIO_IO` 0, `SYNC_IO` 0, `REC_MAX_XFER_SIZE` -1 without errno). Names whose value depends on the mount, kernel options or page size (`ALLOC_SIZE_MIN`, `REC_INCR/MIN_XFER_SIZE`, `MIN_HOLE_SIZE`, the ACL and MAC names, `REC_XFER_ALIGN`) and the four where UFS and `vop_stdpathconf` disagree (`MAX_CANON`, `MAX_INPUT`, `VDISABLE`, `ASYNC_IO`) throw; every other name is `EINVAL`. TechnicalDebt records that the console's filesystem values (PFS on `/app0`) are unverified. - `guest_kernel_sys` gains every implemented name on a file and a directory, `EINVAL` names, the thirteen throwing names, `ENOENT`/`EFAULT`/`ENAMETOOLONG` cases. **Tested** on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including `libs`: `guest_kernel_sys` 3/3; `ctest -j8 -E "^agc_driver_|^video_out_flip"` 533/534, the one failure being `windows_exceptions` (#3411); with `main`'s `Export.cpp` the extended test fails; `tools/check_conventions.py --base main` and `git diff --check` pass. Not run on Linux, no title run. Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
blawesom commented 2026-10-11 13:08:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T13:08:53Z.


Independent verification on Linux: CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON.

  • Rebased d93d0e588 onto current main: one conflict in libkernel_sys/Export.cpp (main's newer Windows privilege constant kept alongside this branch's pathconf constants).
  • tools/check_conventions.py --base origin/main and git diff --check pass.
  • The libkernel_sys tests pass, including the new pathconf cases.
  • Full suite: 832/832 (AMD RX 9070 XT / RADV).

The rebased branch is available at blawesom:verify/3502 for anyone carrying — the commit is otherwise unchanged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109356365 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3502#issuecomment-6109356365). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T13:08:53Z. --- Independent verification on **Linux**: CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`. - Rebased `d93d0e588` onto current `main`: one conflict in `libkernel_sys/Export.cpp` (main's newer Windows privilege constant kept alongside this branch's pathconf constants). - `tools/check_conventions.py --base origin/main` and `git diff --check` pass. - The libkernel_sys tests pass, including the new pathconf cases. - Full suite: **832/832** (AMD RX 9070 XT / RADV). The rebased branch is available at [`blawesom:verify/3502`](https://github.com/blawesom/AnyPS5/tree/verify/3502) for anyone carrying — the commit is otherwise unchanged.
nicolasfalesy commented 2026-10-11 14:14:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-11T14:14:11Z.


Carried in #3611 with all local and CI intake/conventions checks passing.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109926773 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3502#issuecomment-6109926773). Originally posted by [nicolasfalesy](https://github.com/nicolasfalesy) on 2026-10-11T14:14:11Z. --- Carried in #3611 with all local and CI intake/conventions checks passing.
adriadam10 commented 2026-10-12 21:01:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T21:01:48Z.


Fixed by #3611: pathconf (oc98+zOImus) is now exported from libkernel_sys; whether Porpoise boots past it is not verified here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6132544456 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3502#issuecomment-6132544456). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-12T21:01:48Z. --- Fixed by #3611: `pathconf` (`oc98+zOImus`) is now exported from libkernel_sys; whether Porpoise boots past it is not verified here.
oneandonlydean commented 2026-10-13 02:07:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:07:42Z.


Closing: fixed by #3611; pathconf is exported from libkernel_sys. Open a new issue for Porpoise's next stop.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136611087 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3502#issuecomment-6136611087). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T02:07:42Z. --- Closing: fixed by #3611; `pathconf` is exported from libkernel_sys. Open a new issue for Porpoise's next stop.
Sign in to join this conversation.
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#3502
No description provided.