libkernel: kqueue, kevent and the file-event calls are absent (Cloudberry Kingdom, Palworld); implementation ready #3461
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T10:59:19Z.
libkernel does not export
kqueue,kevent,sceKernelAddFileEvent(cG3t15OK4Ow) orsceKernelDeleteFileEvent(UmXngHKB6is). Cloudberry Kingdom (PPSA23827, #3177) callskeventright after start-up with anEVFILT_VNODEregistration, and Palworld's Discord module importskeventand the two file-event calls (#2648).Fix branch ready:
screamm:feat/libkernel-kqueue(two commits onmain6cee0bb0:cd21c720feat(libkernel): implement kqueue and kevent over the event queue,a289fb40feat(libkernel): implement file events). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commits as they are. The Linux inotify path has only been compiled against stub headers on Windows, so a Linux build and run is the first thing it needs.kqueue()reserves a number in the file descriptor space (the same null-device trick the Windows directory descriptors use) backed by an equeue;close/_close/sceKernelClose/dup2onto it close the queue and drop its events from every queue;kevent()follows FreeBSD 11.0.1kern_event.cfor the change list,EV_ERROR/EV_RECEIPT, errno codes and timeout rules, with read/write on guest sockets, timers and user events; a kqueue reports each ready event once per call. Unmodelled filters,EV_DISABLE/EV_DISPATCH/EV_FORCEONESHOT,NOTE_LOWAT,EV_CLEARon a socket, read/write on non-sockets, changes to an existing timer (11.0 vs 11.4 differ) and fractional nanosecond periods above one second throw; the deviations (read/write/fstat on a kqueue, the global timer limit, close waking a waiter) are in TechnicalDebt. The equeue's two event-collection loops are merged into one (will conflict with a fix for #3115).EVFILT_VNODEwatches the host file or directory and maps changes toNOTE_WRITE/EXTEND/ATTRIB/LINK/DELETE/RENAME(Windows:FindFirstChangeNotificationplus a 50 ms poll of size, times and link count, because the directory notification does not fire for a write through an open handle until flush or close; Linux: inotify);sceKernelAddFileEvent(eq, fd, watch, udata)/DeleteFileEventuse the OpenOrbis and SharpProspero signatures withEV_CLEARandwatchasfflags(a guess, recorded).NOTE_REVOKE/OPEN/CLOSE/CLOSE_WRITE/READ, unknown bits andNOTE_EXTENDon a Windows directory throw; sockets, pipes and kqueues returnEINVAL.guest_kqueue: create/close, timers, a user event from another thread, read/write on a socket pair,EV_ERROR, timeout and errors, a vnode watch seeing a write with Cloudberry's exact flags, the sce pair, a directory watch.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs:guest_kqueue,guest_equeue_events,guest_socket_events,guest_dup,guest_ppsa01530_exports3/3 (andguest_kqueue15 runs, 4 at a time);ctest -j8 -E "^agc_driver_|^video_out_flip"528/529, the one failure beingwindows_exceptions(#3411);tools/check_conventions.py --base mainandgit diff --checkpass. Not run on Linux; no title run (if Cloudberry's descriptor is a directory, the WindowsNOTE_EXTENDthrow still stops it).Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T13:08:49Z.
Independent verification on Linux: CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON.a289fb403onto currentmain: one conflict inEqueue.cpp(main and the branch placeGetTriggeredEventson opposite sides ofCollectTriggered; both versions identical, the branch's order kept), plus a duplicatedCollectTriggereddeclaration the replay left inEqueue.hpp(removed).tools/check_conventions.py --base origin/mainandgit diff --checkpass.guest_kqueuepasses, along with the full suite: 833/833 (AMD RX 9070 XT / RADV).The rebased branch is available at
blawesom:verify/3461for anyone carrying — the commit is otherwise unchanged.Imported from boykopovar/AnyPS5. Originally posted by queeeef on 2026-10-11T17:21:53Z.
Tested on Windows with Palworld (PPSA23126, 01.102.999), whose
libdiscord_partner_sdk.prximportskevent,sceKernelAddFileEventandsceKernelDeleteFileEvent(#2648).blawesom:verify/3461(35b3628e) cherry-picks cleanly ontomaina11c8f7f7. Without it the title stops atunresolved ELF import cG3t15OK4Ow from libkernel.prx; with it every import binds and the title runs to character creation (other fixes listed in #2648). I did not check whether the title callskeventor the file-event functions in that time, and I did not run the tests.Windows 11 Pro 26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), RelWithDebInfo. AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T20:59:03Z.
Cloudberry Kingdom (PPSA23827) on
main(0a8b1d32b, plain main), 120 s run:terminate called after throwing an instance of 'std::runtime_error' what(): kqueue_nid_postfix not implemented, after the title looks forconfigsin savedata. Sokqueueis still the first stop on main; #3764 implementskqueue,keventand the file events. I have not run the title with #3764 applied.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T02:10:29Z.
Test with #3764 (kqueue) on main, Windows 10, GCC, 150 s limit: the kqueue/file-event imports bind and the title now stops at
what(): EVFILT_VNODE: NOTE_EXTEND on a directory not implemented(SIGABRT), the throw inFileEvent.cppOpenHostWatchof #3764: the title registers a vnode event withNOTE_EXTENDon a directory. Details in https://github.com/boykopovar/AnyPS5/pull/3764 (comment).AI-assisted (Claude Code).