feat(libkernel_sys): implement link #3403
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3403"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-11T09:44:19Z.
What
Exports
link(Pd7KtJ1gybk) from libkernel_sys, the module the title imports it from, next toreadlink. It maps both guest paths like the other path functions and creates a hard link on the host (std::filesystem::create_hard_link). Errors follow FreeBSD'slink(2), returned as -1 witherrno:EFAULTand an empty oneENOENT, as forreadlinkENOENTEPERMEEXISTEXDEVA symbolic link as the existing path throws, since FreeBSD's
linkfollows it and the host call may not; any other host failure throws as well.PS5VR (PPSA99177) stops at it on
maina73a1af9(catalog build,eboot.binandsce_module/libc.prxunwrapped as #2605 requires; tracked in #1578):app.elf: symbol lookup error: app.elf: undefined symbol: Pd7KtJ1gybkFAIL: unresolved ELF import Pd7KtJ1gybk (link) from libkernel_sys.prxapp.elf: symbol lookup error: app.elf: undefined symbol: +rWFNYiNaEM(fstatfs)FAIL: unresolved ELF import +rWFNYiNaEM (fstatfs) from libkernel_sys.prxTested
Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs, NTFS), Release:
guest_kernel_syspasses 5/5 (--repeat until-fail:5) on both, with no warnings inExport.cpporGuestKernelSys.cpp. The new cases link a 3-byte file, check the link count is 2 and the new name has the same size, truncate through the new name and check the original is truncated too, then check each error above (exceptEXDEV) througherrno, and that removing the new name brings the count back to 1.check_conventions.pypasses. The first version exportedlinkfrom libkernel; a Windows run showed the title imports it from libkernel_sys, so it moved there.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T09:47:09Z.
Progress report (
a73a1af→0e8dc6f)📈 System libraries: 85.45% (+0.01%, +1 implemented functions)
✅ 1 implemented
link_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T09:52:01Z.
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.
main)core/libs/prx/libkernel_sys/Export.cppL18-19, L67core/libs/tests/GuestKernelSys.cppL13-14, L61Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T10:06:48Z.
Checked build and
guest_kernel_syson Linux (libs scope, 17/17 pass); the new cases don't link without the change. Errors match FreeBSDlink(2)(EPERM on directories, EEXIST, ENOENT, EFAULT); symlink source and other host failures throw. Merging.