fix(libSceNet): sceNetEpollControl takes 2 as MOD and 3 as DEL #4110

Merged
jdmagic merged 1 commit from upstream-pr/4110 into main 2026-10-12 07:25:02 +00:00
jdmagic commented 2026-10-11 23:29:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jdmagic on 2026-10-11T23:29:54Z.


What

sceNetEpollControl used Linux's EPOLL_CTL numbering (1 add, 2 delete, 3 modify). The SCE values are 1 add, 2 modify, 3 delete (ORBIS_NET_EPOLL_CTL_* in shadPS4's net_types.h). A delete with op 3 and a null event returned EINVAL, and op 2 removed the registration it was meant to modify.

Sackboy: A Big Adventure (PPSA01289) removes its UDP socket from its epoll with op 3 and a null event before closing it, each time it tears its network session down.

  • The three operations are named constants; op 3 (delete) is the one that accepts a null event.
  • guest_sce_net: op 2 modifies a registration and needs an event, op 3 deletes it with a null event, and a second delete or a modify after it fails with ENOENT.

Tested

Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), on main bca7a29d.

  • guest_sce_net, guest_socket_events, guest_socket_pair, guest_socket_read_write, guest_kernel_errors, guest_filesystem, guest_file_vector: 7/7 passed. The full ctest was not run on this branch.
  • The new guest_sce_net checks fail on main without the change to Export.cpp.
  • PPSA01289 (own dump, converted with the relinker): the EINVAL on the epoll delete is gone. With the other libSceNet fixes (the close/setsockopt and errno PRs) the title reaches its first-boot gamma screen; getting there also needs changes outside this PR.

This PR and the two other libSceNet PRs from this branch set are independent and merge cleanly with each other.

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
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4823206942 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4110). Originally posted by [jdmagic](https://github.com/jdmagic) on 2026-10-11T23:29:54Z. --- ### What `sceNetEpollControl` used Linux's `EPOLL_CTL` numbering (1 add, 2 delete, 3 modify). The SCE values are 1 add, 2 modify, 3 delete (`ORBIS_NET_EPOLL_CTL_*` in shadPS4's `net_types.h`). A delete with op 3 and a null event returned `EINVAL`, and op 2 removed the registration it was meant to modify. Sackboy: A Big Adventure (PPSA01289) removes its UDP socket from its epoll with op 3 and a null event before closing it, each time it tears its network session down. - The three operations are named constants; op 3 (delete) is the one that accepts a null event. - `guest_sce_net`: op 2 modifies a registration and needs an event, op 3 deletes it with a null event, and a second delete or a modify after it fails with `ENOENT`. ### Tested Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), on main bca7a29d. - `guest_sce_net`, `guest_socket_events`, `guest_socket_pair`, `guest_socket_read_write`, `guest_kernel_errors`, `guest_filesystem`, `guest_file_vector`: 7/7 passed. The full `ctest` was not run on this branch. - The new `guest_sce_net` checks fail on main without the change to `Export.cpp`. - PPSA01289 (own dump, converted with the relinker): the `EINVAL` on the epoll delete is gone. With the other libSceNet fixes (the close/setsockopt and errno PRs) the title reaches its first-boot gamma screen; getting there also needs changes outside this PR. This PR and the two other libSceNet PRs from this branch set are independent and merge cleanly with each other. ### 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] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!4110
No description provided.