Repository navigation
Conversation
Dextroid17
left a comment
There was a problem hiding this comment.
Built and ran it, with a bisect, and cross-checked the value against the codebase's own table rather than only against the test.
Linux (CachyOS, GCC, Release):
cmake --build build --target guest_directory_tests --parallel 16
ctest -R ^guest_directory$ → 1/1 Passed
Mutation check — the parent's Directory.cpp with your test kept:
pr-1365 (ELOOP mapped): 1/1 Passed
pr-1365^ (no ELOOP case): Failed
The value is corroborated twice over. 62 is not an arbitrary choice and not the host's:
core/libs/prx/libkernel/KernelErrors.hpp:69definesSCE_KERNEL_ERROR_ELOOP = SceKernelError(62), i.e.0x8002003E— the canonical constant, matching the63your neighbourENAMETOOLONGalready uses.core/libs/prx/libc/src/General.cpp:77already mapstoo_many_symbolic_link_levels → 62for thestd::error_codepath thatchdir/getcwduse. So the errno-based switch inDirectory.cppwas the inconsistent twin, and this change makes the two agree on the guest ABI value instead of introducing a new one.
That second point is also why the change is needed rather than cosmetic: Linux's own ELOOP is 40 and the guest's is 62, so a title that opens a looping symlink had a real chance of seeing the host number. Our errno values are the FreeBSD/PS5 numbering, and the test pins the guest's.
The test is deterministic, which is the right way to test an errno. A self-referential symlink (create_symlink("symlink-loop", symlinkLoop)) loops on every Linux, so it cannot race or depend on privileges the way a chain of symlinks could; it is #ifndef _WIN32-guarded and removed afterwards. I also checked for a second copy of this mapping to fix: there is only the one in General.cpp, and it already had the case, so nothing else needs the same edit.
This is a comment, not an approval — I have no merge rights here.
Written with AI assistance.
|
Same as #1336, for |
Maps native ELOOP to guest errno 62 in the libc directory error converter, so opendir reports a symlink loop with the guest error instead of generic EIO. Adds a POSIX-only self-referential symlink regression case to guest_directory. On Linux, built guest_directory_tests, guest_directory_entry_tests, and guest_working_directory_tests; guest_directory, guest_directory_entries, and guest_working_directory each passed three repetitions. The conventions check and git diff --check passed. Windows symlink behavior was not tested; the regression case is excluded on Windows.