Commit Graph
1187 Commits
Author SHA1 Message Date
Dean Galvin 2f45a312d0 Merge main into fix/setrlimit-nproc 2026-10-23 15:50:49 +13:00
Dean 00439857cb Merge pull request #9840 from Dom3005/fix/fstatfs-character-device
fix(libkernel): answer fstatfs on a character device as devfs does
2026-10-23 15:33:35 +13:00
orezraeyandClaude Opus 5.5 eb838e354d docs(libkernel): keep the edited debt entry under 1000 characters
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 23:00:52 -03:00
orezraeyandClaude Opus 5.5 77e4337f59 docs(libkernel): keep the edited debt entry under 1000 characters
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 23:00:35 -03:00
orezraeyandClaude Opus 5.5 49604e0556 docs(libkernel): keep the edited debt entry under 1000 characters
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 23:00:33 -03:00
orezraey 40f1d631e0 Merge remote-tracking branch 'origin/main' into docs/libkernel-sem-timedwait-measured-ps5 2026-10-22 22:51:29 -03:00
orezraey 216014c846 Merge remote-tracking branch 'origin/main' into fix/libkernel-close-standard-descriptors-measured-ps5 2026-10-22 22:51:28 -03:00
orezraey 369794719f Merge remote-tracking branch 'origin/main' into fix/libkernel-posix-thread-attr-measured-ps5 2026-10-22 22:51:26 -03:00
orezraey 5b546c61f7 Merge remote-tracking branch 'origin/main' into fix/libkernel-sysctl-system-measured-ps5 2026-10-22 22:51:25 -03:00
orezraey 1ca1d0f3ed Merge remote-tracking branch 'origin/main' into fix/libkernel-pthread-attr-measured-ps5 2026-10-22 22:51:23 -03:00
orezraeyandClaude Opus 5.5 ba53bd1975 fix(libkernel): set errno for an out-of-range pthread_setprio as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 22:32:49 -03:00
orezraeyandClaude Opus 5.5 e663b1f7c0 fix(libkernel): report the inheritance through pthread_attr_get_np too
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 22:31:57 -03:00
Dean Galvin ee8d1fe266 Merge main into fix/sigaction-ignore-discards-pending 2026-10-23 14:11:53 +13:00
Dean 39e971a2ea Merge pull request #8985 from MarcZX10/codex/groups-pointer-safety
fix(libkernel): return EFAULT for invalid group pointers
2026-10-23 14:05:39 +13:00
orezraeyandClaude Opus 5.5 791990ad3e fix(libkernel): check the event flag name before the output as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 21:37:07 -03:00
orezraeyandClaude Opus 5.5 bebdfb9003 docs(libkernel): record sem_timedwait timeouts as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 21:29:10 -03:00
orezraeyandClaude Opus 5.5 2c92b0f662 fix(libkernel): refuse closing the standard descriptors with EPERM as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 21:26:24 -03:00
orezraeyandClaude Opus 5.5 bc23ed7853 fix(libkernel): follow the thread priority ranges and POSIX attribute errors measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 21:12:32 -03:00
orezraeyandClaude Opus 5.5 e385217047 fix(libkernel): report the sysctl system strings and integers a PS5 reports
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 21:03:34 -03:00
orezraeyandClaude Opus 5.5 a855c30531 fix(libkernel): follow the destroyed condition marker and thread attribute queries as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 20:47:18 -03:00
Yunus Shaikh b463132a56 Merge main into fix/libkernel-signal-handler-mask
# Conflicts:
#	core/libs/prx/libkernel/System/src/Signals.cpp
#	docs/dev/debt/libkernel.md
2026-10-22 16:27:25 -07:00
Dean 895f47f4ee Merge pull request #8866 from ycbuzi/feat/libkernel-sigintr
feat(libkernel): export _sigintr and let signal honour it
2026-10-23 12:19:08 +13:00
Dean 8964c12d5c Merge pull request #9218 from slopggobblercobbler81/feat/libkernel-setresuid-setresgid
feat(libkernel): implement setresuid and setresgid
2026-10-23 11:10:12 +13:00
Dom3005andClaude Opus 5.5 d426d2f9ef docs(debt): keep the fstatfs entry under the debt length limit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 23:06:03 +02:00
Dom3005andClaude Opus 5.5 93ab8d3514 fix(libkernel): answer fstatfs on a character device as devfs does
FreeBSD keeps every character device on devfs, whose devfs_statfs reports
512-byte blocks, 2 blocks and nothing free. Windows threw for any console,
NUL or the guest random device, and Linux described the host's /dev mount.
A kqueue now returns EINVAL, as getvnode does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 23:06:03 +02:00
Yunus Shaikh 7b6c3aae83 Merge main into feat/libkernel-sys-libthr-names
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-10-22 13:51:29 -07:00
Dean fe8b9b5ddd Merge pull request #8906 from hypermoist/fix/coredump-set-user-data-type
fix(libkernel): give sceCoredumpSetUserDataType its signature and result
2026-10-23 09:41:20 +13:00
orezraeyandClaude Opus 5.5 c399333e7a docs(libkernel): record that released flexible pages keep their host memory
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:09:36 -03:00
orezraeyandClaude Opus 5.5 2f8177d7b4 fix(libkernel): keep the range sceKernelReleaseFlexibleMemory releases mapped
Measured on firmware 13.60: the released range stays mapped with its
protection and contents, and a fixed no-overwrite map over it fails
with ENOMEM; a null or unaligned address, an unaligned length or a
range that wraps returns EINVAL, checked before a zero length, which
returns 0, as does a range with nothing mapped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 17:09:36 -03:00
orezraeyandClaude Opus 5.5 eebb009302 fix(libkernel): report AIO states as a PS5 does after the first read
Measured on firmware 13.60: the first poll or wait that reports a
finished request returns its plain state and later ones add bit
0x10000, while cancel returns the plain state and does not count as a
read; a request that fails completes with state 3 and the error in its
result, and the other requests of its batch still run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 16:57:51 -03:00
orezraeyandClaude Opus 5.5 581a951db8 fix(libkernel): answer unknown AIO ids with ESRCH states as a PS5 does
Measured on firmware 13.60: an id that is not a live request, including
one already deleted, makes poll, wait, cancel and delete return 0 and
write 0x80020003 for it; delete makes an id unknown, and cancel leaves a
finished request's state unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 16:57:51 -03:00
orezraeyandClaude Opus 5.5 2730b6abe5 fix(libkernel): match the AIO batch, priority and parameter limits to PS5
Measured on firmware 13.60: submits take 1 to 128 requests at priority
1 to 3, the id lists of poll, wait, cancel and delete take 1 to 128 ids,
wait takes mode 1 or 2, and sceKernelAioSetParam takes a window and a
delayed count of 0 to 128, a split flag of 0 or 1 and, with split on,
split and chunk sizes of 1 to 0x1000000; everything else returns EINVAL
without writing. sceKernelAioInitializeParam writes the console's three
default scheduling structs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 16:57:51 -03:00
HQasperandClaude Opus 5.5 8fd72f02c5 fix(libkernel): poll kqueues as kqueue_poll answers
A kqueue descriptor is ready for POLLIN and POLLRDNORM while one of its
events is triggered and for no other event, as FreeBSD's kqueue_poll
answers; poll threw for it on both hosts. A kqueue cannot be waited on,
so while one is polled poll checks it every millisecond and waits on the
other descriptors in slices of 1 ms. This is the loop Windows already
used for pipes, which Linux now shares.

A kqueue closed during the wait reports POLLNVAL, and one whose number
was reused is polled again with the rest of the timeout, as FreeBSD's
pollrescan looks the descriptor up again.

Depends on #7248.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 18:13:27 +00:00
bluandClaude Opus 5.5 0017ed2660 Merge branch 'boykopovar:main' into feat/libc-siginterrupt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 10:56:17 -07:00
Adrià 29b25aaf4a Merge pull request #9101 from xXPBSXx/fix/flock-directory-windows
fix(libkernel): accept flock on a directory descriptor on Windows
2026-10-22 19:42:03 +02:00
Adrià c55d7c8e7b Merge pull request #8670 from xXPBSXx/fix/stream-send-after-reset-epipe
fix(libkernel): report EPIPE for a stream send on a connection the peer closed on Windows
2026-10-22 19:40:02 +02:00
Dean 6a6a35fdf5 Merge pull request #7965 from frankea/ps5-measured-1340
fix(libs): values measured on a PS5 (firmware 13.40) from inside retail games
2026-10-23 06:18:10 +13:00
xXPBSXxandClaude Sonnet 5.5 ff2b4ba4cc fix(libkernel): report EPIPE for a stream send on a connection the peer closed on Windows
sosend_generic fails a send on a socket that can send no more with EPIPE
before it looks at so_error. Winsock reports the same send as WSAECONNABORTED
or WSAECONNRESET, which reached the guest as ECONNABORTED or ECONNRESET.
A stream send now maps both to EPIPE. The send-after-close checks of
guest_tcp, guest_socket_read_write and guest_socket_pair run on Windows too.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-22 19:09:29 +02:00
Retr0 124dc3b3ac feat(libkernel): answer kern.boottime in sysctl and sysctlbyname
FreeBSD 11.4 serves kern.boottime ({CTL_KERN, KERN_BOOTTIME}) from
sysctl_kern_boottime in sys/kern/kern_tc.c as a read-only 16-byte struct
timeval, so a size query reports 16, a short buffer gets a partial copy
and ENOMEM, and a write gets EPERM from sysctl_root. sysctl, sysctlbyname
and sysctlnametomib now answer it with the guest CLOCK_REALTIME minus
CLOCK_UPTIME, taken at the first read and kept. HotSpot reads it while
writing its error report, which aborted with "unsupported MIB 1.21".
2026-10-22 20:04:05 +03:00
Retr0 be4fd86249 fix(libkernel): disconnect a connected datagram socket on connect to port 0
FreeBSD 11.4's soconnectat() (sys/kern/uipc_socket.c) disconnects a
connected socket of a protocol without PR_CONNREQUIRED before it calls
pru_connect. udp_disconnect() and udp6_disconnect() drop the peer and
reset the local address, then in_pcbconnect_setup() and in6_pcbladdr()
fail port 0 with EADDRNOTAVAIL, so the socket is left unconnected.
connect to port 0 on a connected datagram socket now dissolves the
association through the AF_UNSPEC disconnect path before failing with 49,
where it kept the old peer. Stream sockets keep EISCONN.
2026-10-22 20:00:13 +03:00
orezraeyandClaude Opus 5.5 d34f5c9181 Merge main into fix/libkernel-msync-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 13:09:58 -03:00
Adrià 8499ea52e5 Merge pull request #8499 from xXPBSXx/fix/sendto-port-zero
fix(libkernel): fail sendto to port 0 from an unbound IPv4 datagram socket with EADDRNOTAVAIL
2026-10-22 17:54:00 +02:00
Adrià 093149c5bd Merge pull request #8483 from xXPBSXx/fix/poll-peer-close-pollin
fix(libkernel): report a stream whose peer closed as readable in poll on Windows
2026-10-22 17:44:27 +02:00
Kraken bf787dc895 chore(libkernel): merge current main for timed join integration 2026-10-22 15:25:35 +01:00
Retr0 f04af479e6 test(libkernel): require EINPROGRESS from a nonblocking connect in progress
FreeBSD 11's kern_connectat fails a nonblocking connect that is still
connecting with EINPROGRESS (36), a second one while it is still
connecting with EALREADY, and soconnectat fails one on a connected
stream socket with EISCONN. On Windows connect has reported
WSAEWOULDBLOCK as EINPROGRESS since 79e162110, but the poll test still
accepted EAGAIN (35) and the socket error numbers debt entry still
listed the gap. Require 36 in the poll test and cut the stale sentence.
2026-10-22 16:59:54 +03:00
Dom3005andClaude Opus 5.5 4892b71494 docs(debt): match the Windows directory descriptor entry to the code
d31e28308 made getdents and getdirentries throw on a name above the
one-byte d_namlen limit, and #8591 made getdirentries report the entry
index of its block through basep. The libkernel entry still described
ENAMETOOLONG and a basep of 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 15:52:04 +02:00
Dean 830ccd121f Merge pull request #9303 from oneandonlydean/fix/getdents-app0-symlink-type
fix(libkernel): report app0 symlinks as their target type in getdirentries
2026-10-23 02:19:24 +13:00
LeandroLP23andClaude Opus 5.5 6e1df42286 feat(libkernel): answer kern.proc.env for the calling process
PS5VR (PPSA99177) reads sysctl {CTL_KERN, KERN_PROC, KERN_PROC_ENV, pid}
for its own pid at start-up and stopped on "unsupported MIB 1.14.35.<pid>".
The call now returns the empty start-up environment that environ and
libc's getenv also begin with, and follows FreeBSD 11's
sysctl_kern_proc_env for the errors: EINVAL for a MIB without exactly one
pid, ESRCH for another pid or -1, EPERM for a write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 14:57:08 +02:00
Yunus Shaikh e8172f8078 fix(libkernel): leave unmeasured scePthreadMutexattrSetkind inputs unimplemented
A null or uninitialized attribute, and a kind outside 1 to 4, threw
std::invalid_argument. They now go through NotImplemented_nid_no_patch,
as pthread_rwlockattr_settype_np's unmeasured types do. FreeBSD 11
libthr stores an unknown kind unchecked and answers a null attribute
with -1 and errno EINVAL, so scePthreadMutexattrSettype's
SCE_KERNEL_ERROR_EINVAL would match neither answer.
2026-10-22 01:44:01 -07:00
SebastianandClaude Opus 5.5 f2766b2447 docs(debt): drop the unmodelled O_EXCL reopen from the named semaphore entry
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QnkpF2oEMofseVz9Z7WEAC
2026-10-22 08:29:03 +00:00