* fix(libkernel_sys): return the console's errors from the Lwfs descriptor calls
* fix(libkernel_sys): return ENOTTY from the Lwfs calls on a kqueue descriptor
* fix(libkernel_sys): answer sceKernelSetCompressionAttribute like the Lwfs calls
* fix(libkernel_sys): import the descriptor checks through extern "C" helpers
* fix(kernel): validate LWFS write buffers and cover regular files
* test(libkernel_sys): open the Lwfs test file through a path alias
Co-authored-by: Petre <90782432+kali113@users.noreply.github.com>
Co-authored-by: kali113 <90782432+kali113@users.noreply.github.com>
The shared SysExports providers let libkernel and libkernel_sys export the same implementations. sceKernelTitleWorkaroundIsEnabled bounds the bit at 0x78, the console-measured bound that landed in 0c372df44e.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix(libkernel_sys): answer sceKernelGetThreadName from the guest thread registry
* fix(libkernel_sys): look the thread name up through an extern "C" libkernel helper
* fix(kernel): reject thread names longer than 31 characters
* docs(libkernel_sys): qualify oversized rename results
* fix(libkernel): follow a PS5 probe for the scePthreadRename name errors
* fix(libkernel): copy the rename string before taking the thread registry lock
* fix(libkernel): check the scePthreadRename thread before the name
Co-authored-by: Petre <90782432+kali113@users.noreply.github.com>
Co-authored-by: kali113 <90782432+kali113@users.noreply.github.com>
Co-authored-by: Dean Galvin <dean.galvin@live.com>
Keep the table of named objects that syscalls 0x22d and 0x22e manage, as
fpPS4's kernel and RPCSX both do: ids from 1 for a name of up to 31
characters, EINVAL for a null name, EFAULT for an unreadable one,
ENAMETOOLONG for a longer one, EAGAIN when no id is left and ESRCH for an id
that is not live. The table holds 65535 ids, RPCSX's bound. Deleting an
object with another type than it was created with throws, because the two
sources disagree on it.
pthread_attr_getaffinity_np, pthread_attr_setaffinity_np and
pthread_attr_getsolosched_np now read the attribute handle and the CPU
set with GuestCopyIn and write the CPU set and solosched with
GuestCopyOut. An unreadable attr returns EINVAL, an unreadable or
unwritable CPU set EFAULT and an unwritable solosched EINVAL, matching
their null forms; errno is preserved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The descriptor was stored through the guest pointer directly, so an
unmapped kq crashed the host. Write it with GuestCopyOut; an unwritable
pointer returns EINVAL like a null one, and errno is preserved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(debt): record symlink of a relative target on a PS5
* docs(debt): keep the reason symlink throws for an absolute target
* docs(libkernel_sys): fold the PS5 symlink result into main's symlink entry
Co-authored-by: Dean Galvin <dean.galvin@live.com>
* feat(libkernel_sys): implement sceKernelGetGenuineProsperoSystemSwVersion
* docs(libkernel_sys): count the stubs left after sceKernelGetGenuineProsperoSystemSwVersion is implemented
Co-authored-by: pr-review2 <pr-review2@users.noreply.github.com>
A payload process on a PS5 (firmware 13.590.001) answers pid 0 as the
calling process and returns ESRCH with errno 3 for -1, INT_MIN and an
unused pid, after the null-output EINVAL check. Other pids keep throwing:
the console answered for its other processes, which AnyPS5 does not have.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(libkernel_sys): pin the multicast bit of the uuidgen node as clear
* fix(libkernel_sys): clear the multicast bit of the uuidgen node
* docs(debt): record the console multicast bit of the uuidgen node
The one conflict is in docs/dev/debt/libkernel_sys.md, where main added the
sceKernelTitleWorkaroundIsEnabled2 entry beside the sceKernelGetProcessType entry this
branch rewrites; both stay, with the measured sceKernelGetProcessType entry.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The nanosleep entry linked libkernel.md#short-sleeps-ended-by-gpu-and-flip-completions,
but libkernel.md has no heading with that slug. The bullet it means
("Short sleeps ended by GPU and flip completions") is under the
points to libkernel.md#functional.
Look the name up as FreeBSD 11.4's sys_swapon does: EFAULT, ENOENT,
ENAMETOOLONG and ENOTDIR for a bad path, and ENOTBLK for any existing
file or directory, since only a disk device can be added as swap.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>