Commit Graph
216 Commits
Author SHA1 Message Date
Adrià 2fab88d102 Merge pull request #5945 from ErenYeager1836/feat/libkernel-sysctl-pagesize
feat(libkernel): report hw.pagesize through sysctl and sysctlnametomib
2026-10-16 22:31:11 +02:00
Adrià 93eca8f7be Merge pull request #5902 from pushkarreddyy/feat/libkernel-setrlimit-nofile
feat(libkernel): allow lowering rlim_cur for RLIMIT_NOFILE in setrlimit
2026-10-16 21:54:11 +02:00
Adrià bafd3227a6 Merge pull request #5901 from KernelPanicNT/feat/libkernel-coredump-thread-context-info
feat(libkernel): answer sceCoredumpGetThreadContextInfo outside the coredump handler
2026-10-16 21:54:05 +02:00
Adrià bc9833e39b Merge pull request #5887 from leorossi2005/feat/libkernel-umtx-microsecond-timeout
feat(libkernel): support microsecond timeout in size-0 _umtx_op
2026-10-16 21:43:51 +02:00
Adrià FranchandClaude 825b7934e7 docs(debt): cite FreeBSD's hw.pagesize OID, note the unmeasured PS5 value
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-16 20:55:50 +02:00
Nithishvelan M 76e05544a9 feat(libkernel): report hw.pagesize through sysctl and sysctlnametomib 2026-10-16 20:55:46 +02:00
Alexej Szpevák d97d6efb1b fix(libkernel): refuse descriptor calls on app0.zar files
flock, fstatfs, ftruncate, fsync, fdatasync, getdirentries, fchmod, futimes and mmap on an archived descriptor acted on its null device and succeeded or failed with an unrelated errno. They now throw NotImplemented, each covered by the kernel archive test; mmap is noexcept, so its refusal is checked through the terminate handler.
2026-10-16 20:03:32 +02:00
Alexej Szpevák 9b911ed510 feat(libkernel): serve app0.zar files through the file calls
sceKernelOpen and open give an archived file a read-only null-device descriptor. Reads, positioned, vectored and AIO reads, seeks, fstat and FIONREAD are served from the archive; dup, dup2 and F_DUPFD share the position. sceKernelStat and sceKernelCheckReachability see archived paths.

Writing opens fail with EROFS, O_CREAT|O_EXCL with EEXIST and O_DIRECTORY on a file with ENOTDIR. Opening an archived directory or one merged with the disk throws until getdents can list it.
2026-10-16 20:03:32 +02:00
pushkarreddyy 2de10e35ff feat(libkernel): allow lowering rlim_cur for RLIMIT_NOFILE in setrlimit 2026-10-16 20:33:46 +05:30
Adrià f35c13fc95 Merge pull request #5833 from Ondra97/codex/fix-windows-vector-io-lock
fix(libkernel): serialize Windows vectored file transfers
2026-10-15 23:15:38 +02:00
Adrià f27697f083 Merge pull request #5847 from akkadbakkad89/feat/kevent-ev-flags
feat(libkernel): implement kevent EV_DISABLE, EV_DISPATCH and EV_FORCEONESHOT
2026-10-15 23:01:10 +02:00
Adrià 3bb409b603 Merge pull request #5784 from gguerra26/fix/macos-m1-andn
fix(relinker): lower ANDN in Rosetta conversion
2026-10-15 19:25:06 +02:00
Adrià 02a1b772ed Merge pull request #5770 from simonbronk/fix/kernel-mprotect-undefined-bits
fix(libkernel): drop undefined protection bits in sceKernelMprotect
2026-10-15 17:53:02 +02:00
Adrià 162adb9da8 Merge pull request #5669 from MarcZX100/codex/signal-mask-128
fix(libkernel): honor all guest signal mask words
2026-10-15 17:03:59 +02:00
Adrià 8a253707e6 Merge pull request #5663 from al3w0f205/feat/libkernel-munlockall
feat(libkernel): add munlockall export
2026-10-15 17:03:54 +02:00
Adrià 9490a6da68 Merge pull request #5617 from Dripl1x/feat/socket-timeouts
feat(libkernel): apply SO_RCVTIMEO and SO_SNDTIMEO on a guest socket
2026-10-15 17:03:37 +02:00
Adrià 63b377b51b Merge pull request #5612 from JJenkx/feat/private-mutex-sharing
fix(libkernel): store mutex process-sharing attributes
2026-10-15 17:03:30 +02:00
Ondra97 65e95f7139 fix(libkernel): serialize Windows vectored file transfers 2026-10-15 15:48:10 +02:00
gguerra26 9b92c55edf fix(relinker): lower ANDN in Rosetta conversion 2026-10-15 15:00:43 +02:00
JJenkx ad78fbcdf7 fix(libkernel): stabilize virtual-query layout across hosts 2026-10-15 08:16:22 -04:00
Adrià 1036905b5f Merge pull request #5565 from Dripl1x/feat/socket-options-nodelay-nosigpipe-nbio
feat(libkernel): answer TCP_NODELAY, SO_NOSIGPIPE and SO_NBIO on a guest socket
2026-10-15 14:11:15 +02:00
Adrià 264a528877 Merge pull request #5556 from Nixitov/feat/rtprio-thread
feat(libkernel): implement rtprio_thread and the pthread concurrency controls
2026-10-15 14:10:58 +02:00
Adrià Franch 0a7193b5cd fix(libkernel): sigsuspend swaps and restores all four mask words 2026-10-15 13:54:05 +02:00
akkadbakkad89andDevin a7da412a71 fix(libkernel): follow kqueue_register for EV_FORCEONESHOT and modify flags
On a new knote EV_FORCEONESHOT is dropped from the flags; on an
existing one it sets EV_ONESHOT and fires the knote, as
kqueue_register does at l.1339-1341. A modify no longer ORs
EV_ONESHOT, EV_CLEAR or EV_DISPATCH into the knote.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-15 06:01:06 +00:00
akkadbakkad89andDevin b32c5a50cd feat(libkernel): implement kevent EV_DISABLE, EV_DISPATCH and EV_FORCEONESHOT
A knote registered or modified with EV_DISABLE stays registered but is
not polled, fired or reported until an EV_ENABLE change re-arms it, as
kern_event.c does with KN_DISABLED. EV_DISPATCH reports an event once
and then disables the knote, and EV_FORCEONESHOT registers as oneshot.
A negative nevents fails with EINVAL instead of throwing.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-15 06:00:43 +00:00
al3w0f205 e03e6f7a4e feat(libkernel): add munlockall export
Follows mlockall (#4386) for XPSemu (PPSA97358, QEMU os-posix.c), which
imports munlockall (NpLBpgVV7PU) from libkernel.prx. Predicted stop:

  FAIL: unresolved ELF import NpLBpgVV7PU from libkernel.prx

The NID is computed with tools/nid_names.py and matches aerolib.

Follows FreeBSD 11.4 sys/vm/vm_mmap.c sys_munlockall
(8c639945a44588f6cfdddfb057bb5aad88735da0): checks PRIV_VM_MUNLOCK,
clears wire state and returns 0. To match, munlockall unlocks ranges
locked by mlock (through VirtualUnlock on Windows, tolerating
ERROR_NOT_LOCKED, and munlockall on Linux).
2026-10-14 18:07:34 -05:00
Leonardo 4b34a6d5a7 feat(libkernel): support microsecond timeout in size-0 _umtx_op 2026-10-14 22:51:54 +02:00
Adrià FranchandClaude 970ff0c795 fix(libkernel): keep sem_timedwait debt entry on its own line, include <algorithm>/<cctype> in the kqueue test
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-14 22:43:43 +02:00
Rujul Talekar e9d367776d fix(libkernel): name the failing vnode watch in the kqueue notification error
The Windows error for a refused FindFirstChangeNotification was one string shared
by WatchParent and WatchContents, so the log could not tell which handle or path
was denied. Build it from the watcher, the path the API was given and
GetLastError instead.

Still throws: the EVFILT_VNODE attach path is vfs_kqfilter, which returns only
EINVAL, ENOMEM or 0, with EBADF from fget before it, and consults no directory
permission, so no FreeBSD errno stands for a host that refuses to notify.
2026-10-14 22:43:39 +02:00
simonbronkandClaude Opus 5.5 ce074f9302 docs(debt): note the protection bits sceKernelMprotect drops
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:51:57 +02:00
Adrià 4b11b97ebb Merge pull request #5096 from sguckiran/main
fix(libkernel): convert local time with the host time zone
2026-10-14 21:38:24 +02:00
Evgeniy KazarinandClaude Opus 5.5 17ded56f12 feat(libkernel): apply SO_RCVTIMEO and SO_SNDTIMEO on a guest socket
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:18:23 +03:00
Evgeniy KazarinandClaude Opus 5.5 7e79f36ed8 feat(libkernel): answer TCP_NODELAY, SO_NOSIGPIPE and SO_NBIO on a guest socket
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:17:26 +03:00
Adrià b0a4753de1 Merge pull request #5230 from hugodearaujo/fix/inherit-creator-priority
fix(libkernel): give an inheriting thread its creator's priority
2026-10-14 21:07:30 +02:00
Adrià 9811e9d4b7 Merge pull request #5218 from YossiYad/fix/guest-arena-mapping-hint
fix(libkernel): fall back below a mapping hint with no room above it
2026-10-14 21:05:23 +02:00
Adrià 066442c961 Merge pull request #5143 from xXPBSXx/fix/mprotect-unmapped-einval-v2
fix(libkernel): fail sceKernelMprotect over an unmapped range with EINVAL instead of aborting
2026-10-14 21:05:05 +02:00
Adrià 5922a728c6 Merge pull request #5020 from xXPBSXx/fix/socket-fd-flags
fix(libkernel): answer F_GETFD and F_SETFD on a guest socket
2026-10-14 21:03:19 +02:00
Adrià 16d7ad035c Merge pull request #4933 from nicolasfalesy/fix/libkernel-poll-scenet-sockets
fix(libkernel): poll libSceNet sockets with the host wait
2026-10-14 21:02:57 +02:00
Adrià e27ff7c545 Merge pull request #5819 from GitamarT045T3R/fix/windows-lstat-symbolic-links
feat(libkernel): report relative symbolic links in lstat on Windows
2026-10-14 20:44:09 +02:00
Dean bebff8b0e8 Merge pull request #3295 from SynnZer0/fix/libkernel-close-host-streams
fix(libkernel): keep host standard streams open on guest close
2026-10-15 07:38:36 +13:00
Dean ed835aa76f Merge pull request #5756 from oneandonlydean/fix/raise-address-lock-1488
fix(libkernel): defer raises while a thread holds the address-wait lock on Windows
2026-10-15 07:01:27 +13:00
Nicolas FalesyandClaude Opus 5.5 62d8eeae76 fix(libkernel): poll libSceNet sockets with the host wait
With libSceNet sockets on ordinary descriptor numbers (#4391), poll on a
libSceNet socket threw "neither a socket nor a pipe": poll only knew
libkernel sockets and pipes, while select already asks libSceNet through
its poller. libSceNet now lends libkernel the host socket behind a
descriptor, together with an owner that keeps it open, so poll puts it in
the same WSAPoll or poll call as libkernel sockets. ProsperoLight
(PPSA99002) stopped here on Linux and now reaches its PC list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EvDbpwUPTa78oCAJqe7m9K
2026-10-14 19:56:10 +02:00
xXPBSXxandClaude Sonnet 5.5 84aa2349f8 fix(libkernel): answer F_GETFD and F_SETFD on a guest socket
fcntl on a guest socket handled F_GETFL and F_SETFL only and failed every other command with EINVAL, so libcurl's fcntl(fd, F_SETFD, FD_CLOEXEC) on a new socket failed (ProsperoRadio PPSA99001, traced by screamm on #4796). Record FD_CLOEXEC per socket descriptor: F_SETFD sets or clears it, F_GETFD reads it, SOCK_CLOEXEC sets it at creation, and dup, dup2 and close start without it, as FreeBSD's kern_fcntl and kern_dup do.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 19:28:40 +02:00
Adrià b60e0bc0a5 Merge pull request #4676 from milescoviello/fix/socket-msg-dontwait
fix(libkernel): accept MSG_DONTWAIT in the socket send and receive calls
2026-10-14 19:13:53 +02:00
Itamar Medyoni 52a3b15796 feat(libkernel): report relative symbolic links in lstat on Windows
lstat of a Windows symbolic link threw, although symlink creates links
with relative targets on Windows and readlink reads them. Report such a
link as S_IFLNK with its own identity and times and the length of its
target as st_size, through the reparse reader readlink already used,
now shared from libkernel. Links with absolute targets, junctions and
other reparse points still throw, as for readlink.
2026-10-14 18:55:31 +02:00
SynnZer0andClaude Opus 5.5 8029428497 fix(libkernel): keep host standard streams open on guest close
Guest descriptors are host C runtime descriptors. Closing descriptor 0, 1
or 2 closed the host process's standard stream, and the runtime then gave
that number to the next file opened anywhere in the process, including
files libkernel opens itself, such as the APR reader's. The title's next
close of the same number closed that file mid-read.

close and sceKernelClose now fail with EBADF for descriptors 0 to 2 that
were open when libkernel loaded, and leave them open. A standard
descriptor that was not open at load can still be opened and closed by
the guest.

PPSA21703 calls sceKernelClose(0) repeatedly while loading asset
bundles, which made APR reads return 0 or a part of the requested bytes
and raised UCRT invalid parameter reports from close.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:46:42 +02:00
KernelPanicNTandClaude Opus 5.5 352a300dd8 feat(libkernel): answer sceCoredumpGetThreadContextInfo outside the coredump handler
sceCoredumpGetThreadContextInfo takes (void* threadContextInfo,
size_t threadContextInfoSize) as in Orbital's IDA type database, and the
144-byte block of 18 64-bit registers follows SharpProspero. It answers
as sceCoredumpGetStopInfoCpu: the handler is never invoked here, so an
aligned 144-byte request returns NOT_IN_COREDUMP_HANDLER without reading
or writing the block, and null, unaligned or wrapping buffers and other
sizes throw, as the console validation order is unverified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 14:45:01 +00:00
Yossi Yadgar aca7a3a46d docs(debt): note the fallback of mapping hints with no room above them 2026-10-14 17:41:40 +03:00
Adrià 5adefa6f89 Merge pull request #5643 from Amirtheshwaran/feat/libkernel-mincore
feat(libkernel): implement mincore
2026-10-14 16:25:54 +02:00
Nixitov 4091519b04 feat(libkernel): implement rtprio_thread and the pthread concurrency controls
Morrowind imports rtprio_thread, pthread_setconcurrency and pthread_getconcurrency and stops at start-up. Report every guest thread as normal priority and accept a set without applying it; store the concurrency level as a hint. Recorded in the libkernel debt.
2026-10-14 16:23:12 +02:00