Commit Graph
58 Commits
Author SHA1 Message Date
Dean 61fc572cee Merge pull request #10434 from Retr0G28/fix/linkat-directory-descriptor
fix(libkernel_sys): resolve linkat paths relative to a directory descriptor
2026-10-25 19:16:10 +13:00
Dean Galvin b0b291be0b Merge main into feat/libkernel-sys-underscore-openat 2026-10-24 21:42:59 +13:00
Retr0 d44d5685eb fix(libkernel_sys): resolve linkat paths relative to a directory descriptor 2026-10-24 02:58:00 +03:00
Dean c675a415f2 Merge pull request #9103 from HQasper/claude/project-thread-w0s18y-chown
feat(libkernel_sys): implement chown, lchown, fchownat and linkat
2026-10-24 11:56:40 +13:00
xXPBSXxandClaude Sonnet 5.5 fba61c0da0 docs(debt): shorten the pathconf entry under the length limit
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 14:01:12 +02:00
xXPBSXxandClaude Sonnet 5.5 01655d7219 fix(libkernel_sys): answer fpathconf for pipes and _PC_ASYNC_IO as FreeBSD does
kern_fpathconf answers _PC_ASYNC_IO with _POSIX_ASYNCHRONOUS_IO (200112) after the descriptor lookup, and a pipe or socket (no vnode) with PIPE_BUF for _PC_PIPE_BUF and EINVAL for every other name. Drop the unused File.hpp include and the duplicate KernelErrors.hpp include.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 13:44:46 +02:00
QuentinRemondandClaude Sonnet 5.5 07d3d6447a feat(libkernel_sys): implement fpathconf and _fpathconf
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 13:44:43 +02:00
Dean 58ceeb8ed5 Merge pull request #9040 from YossiYad/feat/kernel-sys-workaround-process-type
feat(libkernel_sys): implement sceKernelTitleWorkaroundIsEnabled and sceKernelGetProcessType
2026-10-24 00:33:16 +13:00
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
Yossi Yadgar 22823182ef docs(debt): note that sceKernelGetAppInfo leaves the workaround block unwritten 2026-10-23 11:12:23 +03:00
Yossi Yadgar fadfb4433d docs(debt): note where the workaround and process type rules come from 2026-10-23 11:12:23 +03: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
Claude 705f6e1580 feat(libkernel_sys): implement chown, lchown, fchownat and linkat
All four exports threw. The ownership calls follow fchown: owner and
group 0 and the unchanged value are accepted and any other value
throws. The path is looked up first with stat, lstat or fstatat, as
FreeBSD 11's kern_fchownat does, so a lookup error is returned before
the owner is checked. fchownat rejects flags other than
AT_SYMLINK_NOFOLLOW with EINVAL. linkat passes AT_FDCWD and absolute
paths to link and rejects flags other than AT_SYMLINK_FOLLOW with
EINVAL; a relative path with a directory descriptor and a symbolic
link source without AT_SYMLINK_FOLLOW throw. On Windows a symbolic
link source is detected with the file attributes, since libstdc++
there reports it as a regular file.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-23 06:34:32 +00: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
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 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 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
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
bluandClaude Opus 5.5 e9e345fbf3 docs(libkernel_sys): record that link follows longer link chains on Windows
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 07:54:59 -07:00
Yossi Yadgar 26893b36b9 docs(debt): record the sources of the internal module calls 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
erickerxhalliandClaude Opus 5.5 581905d997 docs(libkernel_sys): record which SDK field sceKernelGetCompiledSdkVersion reads
The PS5 payload SDK declares the process parameters with a 32-bit PS4
SDK version at offset 0x10 and a 32-bit PS5 SDK version at 0x14, not
one 64-bit field. The debt entry now states that the export returns the
field at 0x10, as libSceHmd2 and shadPS4 read it, and that which field
the console returns is unmeasured. The test puts different values at
0x10 and 0x14 instead of one 64-bit value with its upper half set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WYjMwvLdPR8iX8EP8tQYWa
2026-10-22 04:20:28 +00:00
MarcZX10 76178efc32 feat(libkernel_sys): implement sched_rr_get_interval 2026-10-21 19:56:32 +00:00
David 478947f71f feat(libkernel_sys): implement the POSIX aio calls 2026-10-21 20:07:41 +01:00
Yossi Yadgar 5cca233e98 docs(debt): record where the libkernel_sys default stack size rule comes from 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
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
NikoandClaude Opus 5.5 673ff23c5b feat(libkernel_sys): export _openat
_openat now opens files as openat does. It reads the mode argument only
when O_CREAT is set, as openat and _open do, and calls openat with the
same descriptor, path, flags and mode, so it returns the same
descriptors and errors.

The PS5 3.20 libkernel_sys export list (DNNDHH/PS5-3.20_Libs) has
_openat, NID bGVEgWXy6dg, as well as openat (A8Yk5AhNDck). In FreeBSD
11.4, _openat is the openat system call stub (lib/libc/sys/Makefile.inc,
amd64/SYS.h) and only libthr's openat adds a cancellation point
(thr_syscalls.c). openat here is not a cancellation point, so
forwarding to it leaves _openat without one, as in FreeBSD.

The openat debt entry now names _openat and no longer says that
O_NOFOLLOW is ignored: open, and so openat, has returned EMLINK for
O_NOFOLLOW on a symbolic link since 9421484572.

The kernel_sys test opens a file through a directory descriptor with
_openat and reads it back, creates one with O_CREAT, O_EXCL and mode
0600, checks outside Windows that it has mode 0600, reopens it for
writing, and checks EEXIST, EINVAL, EBADF and ENOTDIR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 16:25:53 +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
Adrià 5f7aa5570c Merge pull request #7563 from babyhuey/feat/libkernel_sys-fstatat
feat(libkernel_sys): implement fstatat
2026-10-20 16:08:26 +02:00
Adrià 408455bdac Merge pull request #6667 from DavidSamir/fix/libkernel-sys-macos-posix
fix(libkernel_sys): build and check fchdir search permission on macOS
2026-10-19 10:18:13 +02:00
Hannah Lyons 15649b702f feat(libkernel_sys): implement fstatat 2026-10-18 20:39:35 -04:00
Adrià ce8c71a78e Merge pull request #6411 from Nixitov/feat/fchown
feat(libkernel_sys): implement fchown
2026-10-19 01:56:48 +02:00
Maz 7212dae71a fix(libkernel): reject Windows volume mount points in junction reads
A mounted folder uses the junction reparse tag and would otherwise be returned as a relative Volume GUID path. Only a drive path is reported, through the absolute-link text helpers.
2026-10-18 12:53:48 +04:00
Maz 01f3938fe1 fix(libkernel): report Windows directory junctions from lstat and readlink 2026-10-18 01:05:40 +04:00
David e44e828f61 docs(debt): say where fchdir checks search permission
The fchdir entry still said FreeBSD's search-permission check was not
modelled, although it has run on Linux since 0e4d94ce3 and now runs on
every host but Windows.
2026-10-16 07:20:14 +04:00
Nixitov 443df0551b feat(libkernel_sys): implement fchown
Morrowind imports fchown and stops at it once rtprio_thread and the pthread concurrency controls are in. Accept the guest's own owner and group (0) or unchanged (-1), fail an invalid descriptor with EBADF, and throw for another owner or group, since ownership is not modelled.
2026-10-15 16:02:36 +02:00
Parth Bhanti c9d3ff87d9 fix(libkernel_sys): handle AT_SYMLINK_NOFOLLOW natively on macOS and document silent stub 2026-10-15 03:04:18 -07:00
Adrià d67a9e5a45 Merge pull request #4553 from Nixitov/feat/fchmodat
feat(libkernel_sys): implement fchmodat
2026-10-13 17:03:44 +02:00
Nixitov e3c1d01815 feat(libkernel_sys): implement fchmodat
2 Ship 2 Harkinian (PPSA99621) imports fchmodat through std::filesystem::permissions and stops at start-up on main. Resolve AT_FDCWD and absolute paths as usual and join other relative paths to the directory descriptor like openat, accept 0 and AT_SYMLINK_NOFOLLOW, and mask the mode to 07777.
2026-10-13 16:14:53 +02:00