9 Commits
Author SHA1 Message Date
MarcZX10 bef1faf9f5 test(libkernel): dup2 onto a descriptor an equeue watches while it waits
Next to CloseWhileWaitingOnFile: 2000 rounds of watching a regular file and replacing its descriptor with dup2 while another thread waits on the queue.
2026-10-27 04:46:00 +00:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
aarushkhaandClaude Opus 5.5 3e48fb5f5e fix(libkernel): remove equeue events before taking the position lock on close
A wait polling a regular-file event holds the equeue mutex and calls
sceKernelLseek, which takes the descriptor's position lock on Windows.
sceKernelClose and close took that lock first and then the equeue mutex
in EqueueDescriptorClosed, so a close racing such a wait deadlocked. Both
now remove the descriptor's events before taking the position lock, as
dup2 already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 17:40:45 +05:30
aarushkhaandClaude Opus 5.5 7bff640073 feat(libkernel): answer sceKernelAddReadEvent and sceKernelAddWriteEvent on regular files
Both threw for a regular file. They now follow FreeBSD 11.4's
filt_vfsread and filt_vfswrite: a read event reports the file size less
the descriptor's offset and fires while that is not 0; a write event
always fires with data 0. A wait holding such an event polls it again
every millisecond, as no host call reports every file change. A size
above 1 and other vnode types still throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 17:40:45 +05:30
Claude 5c6f6da7dc feat(libkernel): accept pipe read ends in sceKernelAddReadEvent
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-19 18:30:55 +00:00
thuanquangandClaude Opus 5.5 e0da1fb1c9 test(libkernel): time blocking waits from before the writer thread starts
PipeRead (guest_kqueue) and the blocking read in guest_socket_events took
their start time after creating the thread that writes after 50 ms, so a
main thread preempted between the two measured less than the writer's
sleep and failed the 40 ms check although the wait did block until the
write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 04:18:05 +07:00
Alexej Szpevák 93ea8f2684 test(libkernel): check the queued connection count on a listening socket
The listener read event now reports one connection after the first connect, and on Linux two once a second client is waiting, before both are accepted.
2026-10-18 13:35:15 +02:00
kjhq 0abe0b832b feat(libkernel): wake socket read and write events instead of polling
A wait on an equeue that holds socket events now blocks in poll/WSAPoll on
those sockets plus a per-thread loopback wake socket, instead of rechecking
every millisecond. Adding, triggering or deleting an event and closing the
equeue wake the blocked waiters. Closing a socket removes its read and write
events, as on FreeBSD. A read event also reports EV_EOF once the peer has
shut down its sending side.
2026-10-11 01:54:15 +02:00
kjhq 9b7535c6a4 feat(libkernel): implement read and write events for guest sockets
sceKernelAddReadEvent/DeleteReadEvent and sceKernelAddWriteEvent/
DeleteWriteEvent register EVFILT_READ and EVFILT_WRITE events on guest
sockets. The equeue polls the host socket for readiness on each wait
and reports the readable byte count or the send buffer size in data,
with EV_EOF on hang-up or error.
2026-10-11 01:54:04 +02:00