feat(libkernel): implement sceKernelGetEventError #4651

Merged
ErenYeager1836 merged 1 commit from upstream-pr/4651 into main 2026-10-12 21:13:35 +00:00
ErenYeager1836 commented 2026-10-12 17:55:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ErenYeager1836 on 2026-10-12T17:55:13Z.


What

Implement sceKernelGetEventError(const KernelEvent* ev) in libkernel:

  • Returns the event's data when EV_ERROR (0x4000) is set in flags, and 0 otherwise, matching KytyPS5 and FreeBSD 11 kevent behavior where the errno of a failed change is returned in data.
  • Rejects null event pointers via requireEvent, throwing like the other event accessors.
  • Extended GuestEqueueEvents.cpp test suite to cover valid EV_ERROR flag extraction, non-error flags returning 0, and null-argument checks.
  • Documented in TechnicalDebt.md.

Carries @screamm's branch rebased on current main.

Tested

  • Windows 11 (x86_64 MinGW GCC 15 / Ninja).
  • Unit tests: guest_equeue_events passed (ctest -R guest_equeue_events -> 100% passed in 0.64 s).
  • Conventions: python tools/check_conventions.py --base upstream/main passed with 0 errors.

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 (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4833111516 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4651). Originally posted by [ErenYeager1836](https://github.com/ErenYeager1836) on 2026-10-12T17:55:13Z. --- ### What Implement `sceKernelGetEventError(const KernelEvent* ev)` in `libkernel`: - Returns the event's `data` when `EV_ERROR` (0x4000) is set in `flags`, and `0` otherwise, matching KytyPS5 and FreeBSD 11 `kevent` behavior where the errno of a failed change is returned in `data`. - Rejects null event pointers via `requireEvent`, throwing like the other event accessors. - Extended `GuestEqueueEvents.cpp` test suite to cover valid `EV_ERROR` flag extraction, non-error flags returning 0, and null-argument checks. - Documented in `TechnicalDebt.md`. Carries @screamm's branch rebased on current `main`. ### Tested - Windows 11 (x86_64 MinGW GCC 15 / Ninja). - Unit tests: `guest_equeue_events` passed (`ctest -R guest_equeue_events` -> 100% passed in 0.64 s). - Conventions: `python tools/check_conventions.py --base upstream/main` passed with 0 errors. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-12 18:03:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T18:03:04Z.


Progress report (7940cac → a0a238c)

📈 System libraries: 87.57% (+0.02%, +1 implemented functions)

✅ 1 implemented
Library Name
libkernel sceKernelGetEventError
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6129797488 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4651#issuecomment-6129797488). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T18:03:04Z. --- <!-- progress-report --> ### Progress report (7940cac → a0a238c) 📈 **System libraries**: 87.57% (+0.02%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libkernel | `sceKernelGetEventError` | </details>
adriadam10 commented 2026-10-12 21:11:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T21:11:35Z.


Checked on the PR rebased onto current main: guest_equeue_events plus the libkernel/libs ctest scope pass (150/150), and the new test fails without the change. The behaviour matches KytyPS5 KernelGetEventError; the fpPS4 divergence and the unverified console behaviour are recorded in the debt entry.

Rebased only to resolve the adjacent conflict in docs/dev/debt/libkernel.md. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6132681457 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4651#issuecomment-6132681457). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-12T21:11:35Z. --- Checked on the PR rebased onto current `main`: `guest_equeue_events` plus the libkernel/libs ctest scope pass (150/150), and the new test fails without the change. The behaviour matches KytyPS5 `KernelGetEventError`; the fpPS4 divergence and the unverified console behaviour are recorded in the debt entry. Rebased only to resolve the adjacent conflict in `docs/dev/debt/libkernel.md`. Merging once CI is green.
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!4651
No description provided.