feat(libkernel): implement sceKernelGetEventError #3638

Closed
ZekriDev1 wants to merge 1 commit from upstream-pr/3638 into main
ZekriDev1 commented 2026-10-11 14:32:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ZekriDev1 on 2026-10-11T14:32:21Z.


What

Implements sceKernelGetEventError (libkernel/Equeue): null event throws via the shared requireEvent helper (same as all sibling accessors); otherwise returns (int)data when EV_ERROR is set in flags, else 0. Uses the existing in-repo EV_ERROR (Equeue.hpp). Needed so titles reading kqueue/kevent results (cf. TechnicalDebt.md kqueue/kevent titles) get the standard BSD error channel instead of a throw-on-any-call stub. Evidence: FreeBSD sys/sys/event.h (EV_ERROR 0x4000, data contains errno; struct kevent layout matches KernelEvent). Generic behavior, one function, no new dependencies. Uncertainty: console errno values and EV_ERROR production sites unverified; emulator-generated events currently never carry it.

Tested

  • python3 tools/check_conventions.py --base a11c8f7 --head HEAD → pass.
  • python3 -m unittest discover -s tools/tests → 95 tests OK.
  • python3 tools/progress.py → 2904/3383 (85.84%), +1 implemented, not inert.
  • Full cmake build / ctest / GuestEqueueEvents run: not run — no toolchain (cmake/ninja/compiler absent) and submodules uninitialized. Test was written to fail if reverted but not executed here.

Checklist

  • Based on current main; no other open PR implements the same functions (upstream/main = a11c8f7, branch base verified)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt (no // added; verified via conventions check)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt (no new silent stub; this path is implemented)
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title (FreeBSD kevent semantics)
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4819800760 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3638). Originally posted by [ZekriDev1](https://github.com/ZekriDev1) on 2026-10-11T14:32:21Z. --- ### What Implements `sceKernelGetEventError` (`libkernel/Equeue`): null event throws via the shared `requireEvent` helper (same as all sibling accessors); otherwise returns `(int)data` when `EV_ERROR` is set in `flags`, else 0. Uses the existing in-repo `EV_ERROR` (`Equeue.hpp`). Needed so titles reading `kqueue`/`kevent` results (cf. `TechnicalDebt.md` kqueue/kevent titles) get the standard BSD error channel instead of a throw-on-any-call stub. Evidence: FreeBSD `sys/sys/event.h` (`EV_ERROR 0x4000, data contains errno`; `struct kevent` layout matches `KernelEvent`). Generic behavior, one function, no new dependencies. Uncertainty: console errno values and `EV_ERROR` production sites unverified; emulator-generated events currently never carry it. ### Tested - `python3 tools/check_conventions.py --base a11c8f7 --head HEAD` → pass. - `python3 -m unittest discover -s tools/tests` → 95 tests OK. - `python3 tools/progress.py` → 2904/3383 (85.84%), +1 implemented, not inert. - Full `cmake` build / `ctest` / `GuestEqueueEvents` run: not run — no toolchain (`cmake`/`ninja`/compiler absent) and submodules uninitialized. Test was written to fail if reverted but not executed here. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (`upstream/main` = `a11c8f7`, branch base verified) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt (no `//` added; verified via conventions check) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt (no new silent stub; this path is implemented) - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title (FreeBSD `kevent` semantics) - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-11 14:33:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T14:33:11Z.


Progress report (a11c8f7 → f27c8a9)

📈 System libraries: 85.84% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libkernel sceKernelGetEventError
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110096062 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3638#issuecomment-6110096062). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T14:33:11Z. --- <!-- progress-report --> ### Progress report (a11c8f7 → f27c8a9) 📈 **System libraries**: 85.84% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libkernel | `sceKernelGetEventError` | </details>
blawesom commented 2026-10-11 15:19:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T15:19:52Z.


Independent pre-review on Linux (full CI runs only happen on manual trigger, so recording one): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON.

  • Builds; tools/check_conventions.py --base origin/main passes.
  • Full suite: 832/832 passed (all tests including the Vulkan suites on AMD RX 9070 XT / RADV).
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110518528 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3638#issuecomment-6110518528). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T15:19:52Z. --- Independent pre-review on **Linux** (full CI runs only happen on manual trigger, so recording one): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`. - Builds; `tools/check_conventions.py --base origin/main` passes. - Full suite: **832/832 passed** (all tests including the Vulkan suites on AMD RX 9070 XT / RADV).
blawesom commented 2026-10-11 17:19:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T17:19:09Z.


Cross-reference: #3396 implements the same export (sceKernelGetEventError).

CONTRIBUTING.md asks authors to "check that no open pull request already implements the same functions" before starting — both PRs are open, so flagging for the maintainers.

The limitation this creates: only one of the two can be merged; the other gets closed as duplicate, and both currently cost review time in a 340+ queue.

Evidence to help the choice (independent pre-review, Linux — CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON):

  • #3638 (this one): based on current main, CLEAN, full local suite 832/832 green;
  • #3396: 223 commits behind main, currently DIRTY (needs a rebase before it can merge).
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111623348 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3638#issuecomment-6111623348). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T17:19:09Z. --- **Cross-reference: #3396 implements the same export** (`sceKernelGetEventError`). CONTRIBUTING.md asks authors to "check that no open pull request already implements the same functions" before starting — both PRs are open, so flagging for the maintainers. **The limitation this creates:** only one of the two can be merged; the other gets closed as duplicate, and both currently cost review time in a 340+ queue. Evidence to help the choice (independent pre-review, Linux — CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`): - #3638 (this one): based on current `main`, CLEAN, full local suite 832/832 green; - #3396: 223 commits behind `main`, currently DIRTY (needs a rebase before it can merge).
ZekriDev1 commented 2026-10-11 22:32:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ZekriDev1 on 2026-10-11T22:32:55Z.


Superseded by #4046, whose branch contains this exact commit plus the wider coverage batch. Closing to stay within the open-PR limit; please review the equeue change there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114637175 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3638#issuecomment-6114637175). Originally posted by [ZekriDev1](https://github.com/ZekriDev1) on 2026-10-11T22:32:55Z. --- Superseded by #4046, whose branch contains this exact commit plus the wider coverage batch. Closing to stay within the open-PR limit; please review the equeue change there.

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!3638
No description provided.