fix(libkernel_sys): read relative symbolic links on Windows #4253

Merged
codingreapermaps merged 1 commit from upstream-pr/4253 into main 2026-10-12 13:35:50 +00:00
codingreapermaps commented 2026-10-12 02:30:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by codingreapermaps on 2026-10-12T02:30:59Z.


What

readlink threw NotImplemented for every Windows reparse point, including the symbolic links symlink itself creates, so a title that creates a link and reads it back aborted. It now reads the target of a relative symbolic link from the reparse data (FSCTL_GET_REPARSE_POINT) and returns it with / separators, with the same truncation and EFAULT handling as the existing path. Symbolic links with an absolute target and junctions still throw, since a host path has no guest form; other reparse points throw too. TechnicalDebt.md documents the remaining cases.

Tested

Windows 11, MinGW-w64 GCC 15.2.0. guest_kernel_sys passes: file, directory, dangling and non-ASCII links created through symlink, truncated reads, a null buffer, and the throw for an absolute link. tools/check_conventions.py passes. Not tested with a title.

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:4824227475 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4253). Originally posted by [codingreapermaps](https://github.com/codingreapermaps) on 2026-10-12T02:30:59Z. --- ### What `readlink` threw `NotImplemented` for every Windows reparse point, including the symbolic links `symlink` itself creates, so a title that creates a link and reads it back aborted. It now reads the target of a relative symbolic link from the reparse data (`FSCTL_GET_REPARSE_POINT`) and returns it with `/` separators, with the same truncation and `EFAULT` handling as the existing path. Symbolic links with an absolute target and junctions still throw, since a host path has no guest form; other reparse points throw too. `TechnicalDebt.md` documents the remaining cases. ### Tested Windows 11, MinGW-w64 GCC 15.2.0. `guest_kernel_sys` passes: file, directory, dangling and non-ASCII links created through `symlink`, truncated reads, a null buffer, and the throw for an absolute link. `tools/check_conventions.py` passes. Not tested with a title. ### 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-12 13:05:21 +00:00 (Migrated from github.com)

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


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#3611 core/libs/prx/libkernel_sys/Export.cpp L65
#4411 docs/dev/TechnicalDebt.md L401-476
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6124854635 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4253#issuecomment-6124854635). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T13:05:21Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #3611 | `core/libs/prx/libkernel_sys/Export.cpp` [L65](https://github.com/boykopovar/AnyPS5/blob/a1a9c3db593ff0a03f3a337d6e70974a1032cb3c/core/libs/prx/libkernel_sys/Export.cpp#L65) | | | | #4411 | `docs/dev/TechnicalDebt.md` [L401-476](https://github.com/boykopovar/AnyPS5/blob/a1a9c3db593ff0a03f3a337d6e70974a1032cb3c/docs/dev/TechnicalDebt.md#L401-L476) | | |
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!4253
No description provided.