Generate version 1 UUIDs as FreeBSD 11's kern_uuidgen does: consecutive
timestamps from the guest CLOCK_REALTIME, a 14-bit clock sequence that is
randomised on first use and incremented when the clock has not passed the
last batch, and a random multicast node. A count outside 1 to 2048 fails
with EINVAL and a null store with EFAULT.
Implement pthread_attr_setcreatesuspend_np, pthread_resume_np,
pthread_resume_all_np and pthread_multi_np with the sce forms
scePthreadAttrSetcreatesuspend, scePthreadResume, scePthreadResumeAll
and scePthreadMulti, following FreeBSD 11.4 libthr and the firmware
13.42 libkernel_sys module. A thread created suspended waits before its
start routine, outside any cancellation point, until it is resumed.
sceKernelRaiseException throws on Windows for a thread still suspended
at creation.
Measured in a payload process on a PS5 (firmware 13.60) through libkernel_sys.sprx's pathconf: /system_data gives 65536 for the allocation, transfer and hole sizes, 16384 for the transfer alignment, 3 for _PC_ACL_PATH_MAX and 0 for the ACL and MAC flags, and EINVAL for _PC_MAX_CANON, _PC_MAX_INPUT, _PC_VDISABLE and _PC_ASYNC_IO, which used to throw.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
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.
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]>
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]>
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]>
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
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