Commit Graph
111 Commits
Author SHA1 Message Date
Dean 513ca7e558 Merge pull request #9141 from MarrasFederico/feat/kernel-sys-pthread-scope-atfork
feat(libkernel_sys): implement the scePthread scope, atfork and setconcurrency forms
2026-10-23 23:18:24 +13:00
Dean ff191e29d1 Merge pull request #9382 from MarcZX10/codex/libkernel-sys-sched-interval
feat(libkernel_sys): implement sched_rr_get_interval
2026-10-23 22:47:27 +13:00
Dean 1f1acb195e Merge pull request #9322 from zaryabzip/feat/kernel-sys-condattr-getclock
feat(libkernel_sys): implement scePthreadCondattrGetclock
2026-10-23 22:16:46 +13:00
Dean aef58d4674 Merge pull request #9355 from DavidSamir/feat/libkernel-sys-aio
feat(libkernel_sys): implement the POSIX aio calls
2026-10-23 21:28:48 +13:00
Dean f075f91737 Merge pull request #9314 from DavidSamir/feat/libkernel-sys-ktimer
feat(libkernel): implement SIGEV_NONE POSIX timers
2026-10-23 20:34:29 +13:00
zaryabzip 6653dffe62 feat(libkernel_sys): implement scePthreadCondattrGetclock
Read the clock of a libkernel condition attribute, returning
SCE_KERNEL_ERROR_EINVAL for a null or destroyed attribute as
scePthreadCondattrSetclock does, after FreeBSD 11.4 libthr's
_pthread_condattr_getclock. A null clock pointer throws.
2026-10-23 12:17:02 +05:00
Dean c31f139db4 Merge pull request #8890 from UnhealthyKraken/feat/libkernel-pthread-timedjoin
feat(libkernel): implement pthread_timedjoin_np
2026-10-23 20:05:52 +13:00
Dean 9af7d8d810 Merge pull request #8987 from simonbronk/feat/libkernel_sys-pthread-barrier
feat(libkernel_sys): implement the scePthreadBarrier, cpuclockid, concurrency and msync forms
2026-10-23 19:24:34 +13:00
MarcZX10 86f3f07012 merge upstream main into sched interval fix 2026-10-23 05:56:19 +00:00
MarcZX10 d377ed07b9 fix(libkernel_sys): use guest timespec for sched interval 2026-10-23 05:55:48 +00:00
Federico Marras f77f61ec7a Merge remote-tracking branch 'upstream/main' into tmp-9141 2026-10-23 07:12:32 +02:00
Federico Marras f73a4e8133 feat(libkernel_sys): implement the scePthread scope, atfork and setconcurrency forms 2026-10-23 07:12:32 +02:00
Dean 96481a6392 Merge pull request #9294 from YossiYad/feat/kernel-sys-module-internal
feat(libkernel_sys): implement sceKernelGetModuleInfoInternal and sceKernelGetModuleListInternal
2026-10-23 16:43:43 +13:00
Dean ee8a7349b5 Merge pull request #9265 from HQasper/claude/project-thread-6o4na3
feat(libkernel): implement pthread_rwlock_reltimedrdlock_np and pthread_rwlock_reltimedwrlock_np
2026-10-23 16:05:37 +13:00
Dean 3f257f2c4f Merge pull request #9214 from erickerxhalli/claude/anyps5-contribution-5p5n20
feat(libkernel_sys): implement sceKernelGetCompiledSdkVersion
2026-10-23 14:43:23 +13:00
Dean Galvin 0da892c52f Merge main into feat/kernel-sys-module-internal 2026-10-23 14:11:13 +13:00
Dean 5d2eb583bf Merge pull request #9008 from verusferro/feat/libkernel-sys-fstat
feat(libkernel_sys): implement fstat
2026-10-23 13:58:39 +13:00
Dean f1db096084 Merge pull request #9200 from KernelPanicNT/feat/libkernel-sys-lchmod
feat(libkernel_sys): implement lchmod
2026-10-23 12:53:19 +13:00
Dean 287d539503 Merge pull request #9336 from ycbuzi/fix/libkernel-sys-link-follow-windows
fix(libkernel_sys): follow a symbolic link in link on Windows
2026-10-23 11:02:54 +13:00
Adrià a6fc8a467d Merge pull request #8797 from xXPBSXx/fix/unlink-rmdir-dot-component
fix(libkernel): fail unlink and rmdir of a path that ends in a dot component with EINVAL
2026-10-22 20:40:44 +02:00
Adrià FranchandClaude 093a5ba195 fix(libkernel_sys): reach the fchdir vnode check through a _nid_no_patch export
Co-Authored-By: Claude <[email protected]>
2026-10-22 20:15:39 +02:00
xXPBSXxandClaude Sonnet 5.5 e56c6d2ba8 fix(libkernel_sys): keep ENOTDIR from fchdir on a character device
The EINVAL for a descriptor without a vnode now applies only to a pipe or socket. A character device is a vnode on FreeBSD, so getvnode succeeds and change_dir fails with ENOTDIR; File::IsCharacterDevice keeps that answer for the host character devices (a tty, NUL or /dev/null) and the guest random device. guest_kernel_sys pins it with /dev/random.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-22 20:15:26 +02:00
xXPBSXxandClaude Sonnet 5.5 e1605dda52 fix(libkernel_sys): fail fchdir on a pipe or socket with EINVAL
FreeBSD 11.4's sys_fchdir resolves the descriptor with getvnode, which fails with EINVAL for a descriptor that has no vnode; only a vnode that is not a directory gives ENOTDIR from change_dir. fchdir returned ENOTDIR for a pipe or socket. A descriptor that is neither a vnode nor a random device now gets EINVAL; the debt entry records the order of the three errors.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-22 20:15:26 +02:00
Adrià 6671bb3a17 Merge pull request #8723 from xXPBSXx/fix/symlink-target-too-long
fix(libkernel_sys): fail symlink with ENAMETOOLONG for a target of 1024 bytes or more
2026-10-22 19:36:50 +02:00
Kraken 235ea5fd22 fix(libkernel): remove duplicate timed join discovery export 2026-10-22 15:37:19 +01:00
Yossi Yadgar 9ca103df57 feat(libkernel_sys): implement sceKernelGetModuleInfoInternal and sceKernelGetModuleListInternal 2026-10-22 15:52:25 +03:00
SimoneandClaude Opus 5.5 106e73669d feat(libkernel_sys): implement the scePthreadBarrier, cpuclockid, concurrency and msync forms
Forward scePthreadBarrier*, scePthreadBarrierattr*, scePthreadGetcpuclockid,
scePthreadGetconcurrency and sceKernelMsync to libkernel's POSIX
implementations and return POSIX errors as SCE kernel errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 10:01:06 +02:00
Dean d6eafa54d0 Merge pull request #9279 from YossiYad/feat/kernel-sys-thread-defaults
feat(libkernel_sys): implement pthread_set_defaultstacksize_np, scePthreadSetDefaultstacksize and scePthreadSetName
2026-10-22 19:16:30 +13:00
David 05b7d20aed Merge remote-tracking branch 'origin/main' into feat/libkernel-sys-aio
# Conflicts:
#	docs/dev/debt/libkernel_sys.md
2026-10-22 05:29:56 +01:00
blu 9897260c6e Merge branch 'boykopovar:main' into pr/windows-reparse-non-link 2026-10-21 19:08:16 -07:00
David 7820a5353a refactor(libkernel): move the ktimer calls into libkernel
The PS5 3.20 export lists have ktimer_* in libkernel as well as
libkernel_sys, and on Windows a libkernel import never reaches
libkernel_sys. The implementation moves unchanged to
libkernel/Time/Ktimer.cpp.
2026-10-21 22:22:16 +01:00
MarcZX10 76178efc32 feat(libkernel_sys): implement sched_rr_get_interval 2026-10-21 19:56:32 +00:00
bluandClaude Opus 5.5 339d5c11d7 Merge upstream main into fix/libkernel-sys-link-follow-windows
Resolves the conflict with #8522 in link_nid_postfix: keep its ENOTDIR
return for a destination below a regular file and the Windows
symbolic-link follow after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 12:13:24 -07:00
David 478947f71f feat(libkernel_sys): implement the POSIX aio calls 2026-10-21 20:07:41 +01:00
Adrià 38d3c0858a Merge pull request #8522 from xXPBSXx/fix/enotdir-through-file-4
fix(libkernel_sys): fail link, symlink, pathconf and fchmodat through a regular file with ENOTDIR
2026-10-21 20:47:51 +02:00
David bbd9ee6d2c feat(libkernel_sys): implement SIGEV_NONE POSIX timers 2026-10-21 19:09:14 +01:00
bluandClaude Opus 5.5 a293868561 fix(libkernel_sys): follow a symbolic link in link on Windows
link_nid_postfix decided whether to follow the source with
std::filesystem::is_symlink, which MinGW-w64's libstdc++ never reports for
a Windows symbolic link, so on Windows link made a hard link to the link
itself. Follow a reparse-point source to its final path with
GetFinalPathNameByHandleW instead, and run the link-through-a-link case of
guest_kernel_sys on Windows too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 11:00:06 -07:00
Yossi Yadgar 9c4943eec0 feat(libkernel_sys): implement pthread_set_defaultstacksize_np, scePthreadSetDefaultstacksize and scePthreadSetName 2026-10-21 20:24:13 +03:00
erickerxhalliandClaude Opus 5.5 deeea9d284 feat(libkernel_sys): implement sceKernelGetCompiledSdkVersion
Write the low 32 bits of the SDK version field at offset 0x10 of the
title's process parameters and return EINVAL (0x80020016) for a null
output, following shadPS4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WYjMwvLdPR8iX8EP8tQYWa
2026-10-21 15:37:11 +00:00
Claude 8f13fe70b9 feat(libkernel): implement pthread_rwlock_reltimedrdlock_np and pthread_rwlock_reltimedwrlock_np
Both were missing from libkernel.prx, so a title importing either
(dYv-+If2GPk, RRnSj8h8VR4) failed to load. They take a relative timeout
in microseconds and are scePthreadRwlockTimedrdlock and
scePthreadRwlockTimedwrlock with POSIX error numbers; a zero lock is
initialized as by pthread_rwlock_rdlock. The signature comes from
shadPS4, which registers one function for each NID and its
scePthreadRwlockTimed* twin; FreeBSD 11.4 has no such calls. The throwing
libkernel_sys copies are removed, as an export may live in one library
only. Recorded in the libkernel debt file.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-21 15:27:52 +00:00
KernelPanicNT 0858e024fb feat(libkernel_sys): implement lchmod
lchmod forwards to fchmodat with AT_FDCWD and AT_SYMLINK_NOFOLLOW, as
FreeBSD 11.4's sys_lchmod does. On Linux and Windows, which cannot change
the mode of a symbolic link itself, a symbolic link throws instead of
succeeding without a change.
2026-10-21 14:54:33 +00:00
verusferro 29f1a34ccb feat(libkernel_sys): implement fstat
fstat was a NotImplemented stub in libkernel_sys. It now calls libkernel's
_fstat, as fstatfs already calls _fstatfs, so it reports the same status,
EFAULT for a null buffer and EBADF for a descriptor that is not open.
2026-10-21 12:31:34 +03:00
blu 04b1d6e5b5 Merge branch 'boykopovar:main' into pr/windows-reparse-non-link 2026-10-20 23:38:51 -07:00
xXPBSXxandClaude Sonnet 5.5 a2a77714d5 fix(libkernel): fail unlink and rmdir of a path that ends in a dot component with EINVAL
FreeBSD lookup() refuses "." and ".." as the last component of a DELETE
lookup with EINVAL (sys/kern/vfs_lookup.c:750-754 and 823-826), before the
unlink and rmdir checks run. unlink and sceKernelUnlink answered EPERM,
rmdir and sceKernelRmdir answered ENOTEMPTY for "..", and unlinkat without
AT_REMOVEDIR answered EPERM. Reuse the RenameDot check added for rename, so a
missing or non-directory parent still reports ENOENT or ENOTDIR first.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-21 08:01:47 +02:00
xdCloudy 44c531bf0f feat(prx): add missing libkernel_sys exports 2026-10-21 02:37:20 +01:00
Dean bfd6c27d65 Merge pull request #8312 from altuux/fix/libkernel-sys-readlink-notdir
fix(libkernel_sys): fail readlink through a regular file with ENOTDIR on Windows
2026-10-21 12:06:42 +13:00
xXPBSXxandClaude Sonnet 5.5 b3a9fbe3ea fix(libkernel_sys): fail symlink with ENAMETOOLONG for a target of MAXPATHLEN bytes or more
FreeBSD 11.4 kern_symlinkat copies the target with copyinstr(path1, ..., MAXPATHLEN)
(sys/kern/vfs_syscalls.c:1490), so a target of 1024 bytes or more fails with
ENAMETOOLONG before the link name is looked up. symlink_nid_postfix had no length
check on the target.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-21 00:19:07 +02:00
altuuxandAntigravity a685523018 fix(libkernel_sys): fail readlink through a regular file with ENOTDIR on Windows
A path whose directory part is a regular file, such as file/child, failed
with ENOENT in readlink and readlinkat on Windows, where FreeBSD 11.4 fails
it with ENOTDIR (vfs_cache_lookup, sys/kern/vfs_cache.c). The not-found
error now checks whether the nearest existing ancestor is not a directory,
as was previously done for chmod, truncate, utimes, rename, remove, chdir,
opendir, and fopen.

Co-Authored-By: Antigravity <[email protected]>
2026-10-20 20:25:13 +02:00
xXPBSXxandClaude Sonnet 5.5 994fb42929 fix(libkernel_sys): check the readlink size before the path
FreeBSD 11.4 kern_readlinkat returns EINVAL for a count above IOSIZE_MAX
before namei looks at the path. readlink and readlinkat checked a NULL or
empty path first, so readlink(NULL, buf, SIZE_MAX) returned EFAULT and
readlink("", buf, SIZE_MAX) returned ENOENT where FreeBSD returns EINVAL.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 20:02:22 +02:00
bluandClaude Opus 5.5 0ecef87c4c fix(libkernel): answer Windows reparse points that are not links
lstat and readlink threw NotImplemented for every Windows reparse point
other than a symbolic link or a drive junction. A tag without the name
surrogate bit (cloud files, deduplication) does not stand for another path,
so lstat now answers as stat does and readlink returns EINVAL, as FreeBSD
does for a file that is not a link and as CPython's os.lstat and os.readlink
do (bpo-37834). A name surrogate that is neither a symbolic link nor a
junction (a mounted volume, a WSL link) is reported as the reparse point
itself with the mode of its attributes, and readlink returns EINVAL.

The tests set reparse tags with FSCTL_SET_REPARSE_POINT, one without the
name surrogate bit and one with it. A compact /exe (WOF) file cannot serve
as the fixture: on Windows 11 24H2 the WOF filter hides the reparse point
from GetFileAttributesW and FileAttributeTagInfo alike. Windows refuses
every open of an unhandled tag without FILE_FLAG_OPEN_REPARSE_POINT, so the
test requires lstat to agree with stat rather than to succeed.

mashingaan's boykopovar/AnyPS5#6447 returned EINVAL for other reparse
points without the tag check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-20 08:21:33 -07:00