Skip to content

fix(libkernel): report symlink types in Windows getdents - #4936

Closed
MarcZX10 wants to merge 1 commit into
boykopovar:mainfrom
MarcZX10:codex/windows-getdents-symlink-type
Closed

MarcZX10 wants to merge 1 commit into
boykopovar:mainfrom
MarcZX10:codex/windows-getdents-symlink-type

Conversation

@MarcZX10

Copy link
Copy Markdown
Contributor

What

The Windows directory descriptor backend classified each entry by following it with directory_entry::is_directory(). As a result, a symlink to a directory was reported as DT_DIR, and a symlink to a file was reported as DT_REG. Linux getdents reports the directory entry itself as DT_LNK; libc readdir in this project already uses symlink_status for that distinction.

Classify Windows sceKernelGetdents entries using symlink_status, preserving symlinks as guest type 10. Extend the shared directory-entry regression to include both a file symlink and a directory symlink.

Tested

  • Debian 12 / GCC 12.2 / Release / Ninja: guest_directory_entry_tests built.
  • ctest --test-dir build-getdents -R '^guest_directory_entries$' --output-on-failure: passed (1/1).
  • MinGW-w64 GCC 12 -Wall -Wextra -Werror compile of the Windows DirectoryDescriptor.cpp path: passed.
  • python3 tools/check_conventions.py --base upstream/main --head HEAD: passed.
  • python3 tools/check_test_registration.py build-getdents: 762 test executables, 0 built and unrun.
  • git diff --check upstream/main...HEAD: passed.
  • Windows runtime execution was not available in this Linux session; the regression assertions are included for Windows runs.

Checklist

  • Based on current main; no other open PR implements the same behavior
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No investigation notes or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behavior, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes

@xXPBSXx

xXPBSXx commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Windows build check of this PR.

Environment: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, BUILD_TESTING=ON, -j2, libusb-cmake from a local checkout. Built from main c2565f014 with this PR and ten other open PRs (#4972, #4967, #4966, #4945, #4938, #4936, #4933, #4898, #4896, #4888) merged together; the merges had no conflict.

Result: the merged tree builds, but no test of this PR runs on Windows: its test (guest_directory_entry) is registered only for non-Windows builds (if(NOT WIN32)), although the change is for Windows getdents.

Not checked: any behaviour of the change on Windows; no title run.

AI-assisted (Claude Code).

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants