feat(libkernel): report the error carried by an equeue event #2003

Closed
evDev69 wants to merge 1 commit from upstream-pr/2003 into main
evDev69 commented 2026-10-09 04:52:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by evDev69 on 2026-10-09T04:52:20Z.


What

Implements sceKernelGetEventError. When the event has EV_ERROR (0x4000) set, it returns data, the errno the kernel stored there; otherwise 0. A null event throws, like the other sceKernelGetEvent* accessors.

Sources: FreeBSD kevent semantics for EV_ERROR; KytyPS5 (KernelGetEventError) does the same; SharpProspero documents it as the event's error number or zero.

Tested

See shared notes. guest_equeue_events gains checks for no flag, EV_ERROR with data 22, every other flag bit set, and null. The test aborts without the change and passes with it.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4796133155 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2003). Originally posted by [evDev69](https://github.com/evDev69) on 2026-10-09T04:52:20Z. --- ### What Implements `sceKernelGetEventError`. When the event has `EV_ERROR` (0x4000) set, it returns `data`, the errno the kernel stored there; otherwise 0. A null event throws, like the other `sceKernelGetEvent*` accessors. Sources: FreeBSD kevent semantics for `EV_ERROR`; [KytyPS5](https://github.com/KytyPS5/KytyPS5/blob/main/src/kernel/eventQueue.cpp) (`KernelGetEventError`) does the same; [SharpProspero](https://github.com/SvenGDK/SharpProspero/blob/main/src/SharpProspero/Interop/Kernel/KernelEqueue.cs) documents it as the event's error number or zero. ### Tested See shared notes. `guest_equeue_events` gains checks for no flag, `EV_ERROR` with data 22, every other flag bit set, and null. The test aborts without the change and passes with it. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
WifeInLantern commented 2026-10-09 07:50:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by WifeInLantern on 2026-10-09T07:50:12Z.


Heads-up: #950 (opened 2026-10-06) already implements sceKernelGetEventError with the same behaviour (data under EV_ERROR, else 0), has CI passing on Linux and Windows, and has had a review. I tested it on Windows and commented there. The maintainers will decide which to keep; this is only so you know about the overlap.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6076783603 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2003#issuecomment-6076783603). Originally posted by [WifeInLantern](https://github.com/WifeInLantern) on 2026-10-09T07:50:12Z. --- Heads-up: #950 (opened 2026-10-06) already implements `sceKernelGetEventError` with the same behaviour (`data` under `EV_ERROR`, else 0), has CI passing on Linux and Windows, and has had a review. I tested it on Windows and commented there. The maintainers will decide which to keep; this is only so you know about the overlap.
oneandonlydean commented 2026-10-09 08:55:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:55:53Z.


Closing: nothing shows a title calling sceKernelGetEventError on main. Reopen with the title ID and the log line if one does.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077721831 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2003#issuecomment-6077721831). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T08:55:53Z. --- Closing: nothing shows a title calling `sceKernelGetEventError` on main. Reopen with the title ID and the log line if one does.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2003
No description provided.