Commit Graph

910 Commits

Author SHA1 Message Date
Dean 9df77462cc
Merge pull request #4544 from poonasor/feat/libkernel-module-info2
feat(libkernel): implement sceKernelGetModuleList2 and sceKernelGetModuleInfo2
2026-10-13 07:33:08 +13:00
Dean 21c27e60a4
Merge pull request #4536 from orishamir/fix/debugout-host-stderr
fix(libkernel): keep sceKernelDebugOutText off a redirected guest stderr
2026-10-13 07:31:53 +13:00
Dean 3b5c96377d
Merge pull request #4516 from Ondra97/codex/file-lock-lifetime
fix(libs): share Windows flock state between duplicated descriptors
2026-10-13 07:30:48 +13:00
Dean f7b238e43b
Merge pull request #4513 from winstrex/fix/libkernel-open-directory-trailing-separator
fix(libkernel): open directories whose host path ends in a separator on Windows
2026-10-13 07:30:26 +13:00
Dean 60f4c71608
Merge pull request #4466 from babyhuey/feat/libkernel-socid-cpumode
feat(libkernel): export sceKernelGetMainSocId, sceKernelGetCpumode and sceKernelGetCpuFrequency
2026-10-13 07:27:28 +13:00
Dean 30e169127d
Merge pull request #4419 from Ondra97/codex/deferred-module-lifetime
fix(libkernel): bind deferred initialization to the loaded image
2026-10-13 07:24:39 +13:00
Dean b5546111b6
Merge pull request #4373 from milescoviello/fix/recvmsg-seqpacket-trunc
fix(libkernel): report MSG_TRUNC for SOCK_SEQPACKET records in recvmsg
2026-10-13 07:22:38 +13:00
Dean edddd6a17b
Merge pull request #4370 from milescoviello/fix/ipv6-only-sockets
fix(net): make new IPv6 sockets IPv6-only as FreeBSD does
2026-10-13 07:21:34 +13:00
Dean 2a5eca11cd
Merge pull request #4350 from milescoviello/fix/once-reset-on-exit
fix(libkernel): reset a once control when its initializer exits or is cancelled
2026-10-13 04:53:46 +13:00
Dean a7614930a4
Merge pull request #4349 from milescoviello/fix/open-nofollow
fix(libkernel): fail open with O_NOFOLLOW on a symbolic link
2026-10-13 04:53:25 +13:00
Dean 3881117feb
Merge pull request #4348 from milescoviello/fix/rmdir-symlink
fix(libkernel): fail rmdir on a symbolic link instead of removing it
2026-10-13 04:53:02 +13:00
poonasor 08824f3b90 feat(libkernel): implement sceKernelGetModuleList2 and sceKernelGetModuleInfo2
The title-module variants of sceKernelGetModuleList and
sceKernelGetModuleInfo, following shadPS4: the list leaves out system
libraries and the info call answers EPERM for one. A system library is
a loaded .prx image that is not a relinked title module.

NHL 27 (PPSA34063) imports both and fails to load without them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 11:15:26 -04:00
Ori Shamir fc0d46ba00 fix(libkernel): throw instead of aborting when there is no host standard error to keep
A Windows GUI build started without standard handles has no descriptor 2.
_dup(2) then reached the invalid-parameter handler, which aborts, before the
"cannot keep the host standard error" error could be thrown. It now goes
through WithoutParameterHandler like the other descriptor calls in this file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:53:41 +03:00
Scott Schuster 2585eeb7ee fix(libkernel): keep sceKernelDebugOutText off a redirected guest stderr
Guest descriptors are host descriptors, so a guest that moves standard
error with dup2 also moves the stream sceKernelDebugOutText writes to. A
title that forwards its standard error to the kernel log through a pipe
then reads its own debug output back and logs it again without end. Before
the guest's first dup2 onto descriptor 2, the host's standard error is kept,
and sceKernelDebugOutText writes there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:53:41 +03:00
Dean fe66af13ef
Merge pull request #4038 from santhoshkumar-dev/fix/libkernel-symlink-file-size
fix(libkernel): report the target size of symbolic links on Windows
2026-10-13 03:08:09 +13:00
Ondra97 bd842bc7d2 fix(libs): share Windows flock state between duplicated descriptors 2026-10-12 16:03:47 +02:00
Dean ddc713fbcf
Merge pull request #4004 from zmeizy/claude/mutex-timedlock-try-first
fix(libkernel): try the lock before checking the pthread_mutex_timedl…
2026-10-13 02:34:16 +13:00
Dean f4b395e28e
Merge pull request #3971 from arreina/fix/param-json-nesting
fix(libkernel): limit param.json nesting depth
2026-10-13 02:33:55 +13:00
Dean fefecc61c2
Merge pull request #3954 from MarcZX100/codex/carry-clock-error
fix(libkernel): return SCE errors when clock calls fail
2026-10-13 02:33:12 +13:00
Dean 11c9522cf9
Merge pull request #3893 from MarcZX100/codex/carry-credential-setters-3862
feat(libkernel): export credential setters and supplementary groups
2026-10-13 02:31:36 +13:00
winstrex a47178b86f fix(libkernel): open directories whose host path ends in a separator on Windows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 10:06:44 -03:00
Dean 9bc4356990
Merge pull request #4295 from AaravMehta-07/codex/kernel-socket-address-length
fix(libkernel): report copied socket address lengths
2026-10-13 01:57:25 +13:00
Hannah Lyons 4e3aa159d9 feat(libkernel): export sceKernelGetMainSocId, sceKernelGetCpumode and sceKernelGetCpuFrequency 2026-10-12 08:32:16 -04:00
Dean 90c7ab3390
Merge pull request #4102 from itsbo5/fix/libkernel-udp-send-edestaddrreq
fix(libkernel): return EDESTADDRREQ for send and sendto on unconnecte…
2026-10-13 01:28:39 +13:00
Dean 104bb65c94
Merge pull request #4093 from kallmek3nny/fix/aio-precise-poll-sleep
fix(aio): use precise polling sleep
2026-10-13 01:27:47 +13:00
Dean fb23e85f66
Merge pull request #4063 from MarcZX100/codex/carry-pthread-join-self-4052
fix(libkernel): return EDEADLK for self-join and EINVAL for null threads
2026-10-13 01:25:36 +13:00
Dean 6ee0720ded
Merge pull request #4311 from leorossi2005/feat/libkernel-cpu-temperature
feat(libkernel): implement sceKernelGetCpuTemperature
2026-10-13 01:24:01 +13:00
Dean a951cef8f4
Merge pull request #4272 from Ondra97/codex/socket-receive-host-write
fix(libs): allow socket receives into watched guest memory
2026-10-13 01:22:17 +13:00
Dean 9a1922145d
Merge pull request #4080 from hugodearaujo/fix/rwlock-destroy-held
fix(libkernel): destroy rwlocks the way the console does
2026-10-13 01:21:08 +13:00
Dean ed14cb4e0a
Merge pull request #4053 from nikowolf123/fix/libkernel-close-guest-sockets
fix(libkernel): close guest sockets in sceKernelClose
2026-10-13 01:20:47 +13:00
Dean ffa198407e
Merge pull request #3765 from pushkarreddyy/feat/libkernel-wait-rlimits
feat(libkernel): answer getrlimit for FreeBSD resources
2026-10-13 00:44:48 +13:00
Dean 7300101fa2
Merge pull request #3700 from pushkarreddyy/feat/libkernel-sysctl-kern-arandom
feat(libkernel): support MIB 1.37 (kern.arandom) in sysctl
2026-10-13 00:43:14 +13:00
Dean 5f3b94cb19
Merge pull request #3840 from ahir061/feat/libkernel-fcntl-files
feat(libkernel): support fcntl and ioctl on non-socket descriptors
2026-10-12 23:53:24 +13:00
Dean 5a031d49e8
Merge pull request #4324 from abhinav29102005/feat/libkernel-memory-pool-commit-type
fix(libkernel): propagate memory type in sceKernelMemoryPoolCommit and batch commit
2026-10-12 23:53:02 +13:00
Dean c390d81552
Merge pull request #4326 from winstrex/feat/libkernel-sceKernelEnableDmemAliasing
feat(libkernel): implement sceKernelEnableDmemAliasing
2026-10-12 23:50:39 +13:00
Dean 7cb5238d53
Merge pull request #4281 from eljackjoestar-cmd/codex/reserve-direct-memory
perf(libkernel): commit Windows direct backing when mapped
2026-10-12 23:49:42 +13:00
Dean c3204078e4
Merge pull request #4270 from ErenYeager1836/fix/shm-unlink-windows-return
fix(libkernel): return after NotImplemented in Windows shm_unlink
2026-10-12 23:46:32 +13:00
Ondra97 ec5688a666 fix(libkernel): bind deferred initialization to the loaded image 2026-10-12 12:34:35 +02:00
milescoviello 98f6639e9e fix(net): make new IPv6 sockets IPv6-only as FreeBSD does
On Linux, socket() and sceNetSocket() create AF_INET6 sockets in the
host's default dual-stack mode (net.ipv6.bindv6only is 0), so a wildcard
IPv6 bind also claims the IPv4 port. A title that keeps an IPv4 and an
IPv6 socket on the same port fails: with 0.0.0.0:P bound, binding [::]:P
returns EADDRINUSE (48), and an IPv6 socket bound to [::] also receives
IPv4 traffic from v4-mapped peers.

FreeBSD makes every new IPv6 socket IPv6-only. sys/netinet6/in6_proto.c:

	VNET_DEFINE(int, ip6_v6only) = 1;

sys/netinet/in_pcb.c, in_pcballoc():

	if (INP_SOCKAF(so) == AF_INET6) {
		inp->inp_vflag |= INP_IPV6PROTO;
		if (V_ip6_v6only)
			inp->inp_flags |= IN6P_IPV6_V6ONLY;
	}

and sys/netinet6/in6_pcb.c, in6_pcbbind(), looks for an IPv4 owner of
the port only when the flag is clear:

	if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 &&
	    IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {

socket() and sceNetSocket() now set IPV6_V6ONLY on every IPv6 socket
they create. Windows already defaults to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 08:44:27 +00:00
Dean c36fd0a0eb
Merge pull request #4321 from oneandonlydean/up4/fix-3308-watch-mapping
perf(libkernel): find direct mappings that share physical memory through an index
2026-10-12 21:43:41 +13:00
Dean a3b3cec05e
Merge pull request #4230 from MarcZX100/codex/carry-socket-flags-4028
fix(libkernel): accept socket type flags
2026-10-12 21:42:57 +13:00
Dean 9fdddc8747
Merge pull request #4160 from hugodearaujo/fix/join-self-create-attr
fix(libkernel): join the calling thread and create from an unset attribute as the console does
2026-10-12 21:42:14 +13:00
Dean 82fc98f5e5
Merge pull request #4158 from hugodearaujo/fix/mutex-errors
fix(libkernel): return the console's errors from the SCE mutex calls
2026-10-12 21:41:52 +13:00
Dean 5ccf78e4e3
Merge pull request #4153 from hugodearaujo/fix/pthread-attr-errors
fix(libkernel): return the console's errors from the scePthreadAttr calls
2026-10-12 21:41:31 +13:00
Dean 69f7411ec9
Merge pull request #4096 from hugodearaujo/fix/solosched-values
fix(libkernel): accept only the solo scheduling values the console accepts
2026-10-12 21:40:24 +13:00
Dean 9b152c43d0
Merge pull request #4090 from yunusshaikh7/fix/libc-fopen-delete-sharing-windows
fix(libc): open fopen streams with delete sharing on Windows
2026-10-12 21:39:18 +13:00
Dean 10aff1c663
Merge pull request #4077 from hugodearaujo/fix/sched-priority-range
fix(libkernel): report the console's scheduling priority range
2026-10-12 21:38:56 +13:00
Dean 7b03a42185
Merge pull request #3659 from MarcZX100/carry/win-getdents-name-limit-3327
fix(libkernel): reject oversized Windows directory entry names
2026-10-12 21:35:24 +13:00
Santhosh Kumar 6b38cdda8c fix(libkernel): report the target size of symbolic links on Windows
_wstat64, the FindFirstFileExW listing and std::filesystem::file_size
report the size of a file symbolic link itself (0). stat therefore gave
0 for linked files, and APR resolved them as empty, so Unity treated a
linked globalgamemanagers as empty and never read it.

stat takes the size from the handle it already opens, which follows the
link. The APR listing skips reparse points, and names missing from it
are sized through stat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:48:56 +05:30
milescoviello 19bfa3db29 fix(libkernel): report MSG_TRUNC for SOCK_SEQPACKET records in recvmsg
recvmsg() reads one byte more than the guest buffers hold to see
whether a record did not fit, but only for SOCK_DGRAM sockets. On a
SOCK_SEQPACKET socketpair a record longer than the buffers was cut
short with msg_flags 0: a 6-byte record received into 2 bytes returned
2 and no MSG_TRUNC, and the rest of the record was gone.

FreeBSD's SOCK_SEQPACKET protocol is atomic, sys/kern/uipc_usrreq.c:

	.pr_type =		SOCK_SEQPACKET,
	...
	.pr_flags =		PR_ADDR|PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD|
				    PR_RIGHTS,

and its receive routine, soreceive_generic() in sys/kern/uipc_socket.c,
flags the truncation of an atomic record and drops its rest:

	if (m != NULL && pr->pr_flags & PR_ATOMIC) {
		flags |= MSG_TRUNC;
		if ((flags & MSG_PEEK) == 0)
			(void) sbdroprecord_locked(&so->so_rcv);
	}

which kern_recvit() hands back in msg_flags. recvmsg() now probes for a
longer record on SOCK_SEQPACKET sockets as it does for SOCK_DGRAM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 08:03:38 +00:00