feat(libSceNet): implement sceNetResolverAbort #1502

Closed
AcelezXYZ wants to merge 1 commit from upstream-pr/1502 into main
AcelezXYZ commented 2026-10-08 10:05:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AcelezXYZ on 2026-10-08T10:05:23Z.


What

Implements sceNetResolverAbort(rid, flags) in libSceNet (PPSA23566 imports it).

  • Flag 0x1 keeps an abort for the next sceNetResolverStartNtoa, flag 0x2 for the next sceNetResolverStartAton. The preserved abort makes that lookup fail once with EINTR (0x80410104, errno 4) and sets the resolver error to the same value.
  • Argument errors are checked before the preserved abort, so an invalid call does not consume it.
  • Unknown resolver id returns EBADF; other flag bits throw.
  • Lookups are synchronous here, so a lookup already running on another thread is not interrupted. Documented in TechnicalDebt; the function is removed from the PPSA23566 unknown-signature list.

Signature, flags and the EINTR result follow the shadPS4 reimplementation of the PS4 library (AbortResolver/RunLookup in net_resolver.cpp), not confirmed on a PS5 title.

Tested

  • Linux x86-64, GCC 13.3, Release build, full ctest: 441/442 pass. The only failure is guest_sce_net, which already aborts in CheckUnspecifiedIpv6 in my sandbox (no IPv6 available), also on unmodified main, before the new checks run.
  • With that one call skipped locally, guest_sce_net passes including the new checks: abort without flag has no effect, NTOA and ATON preservation are consumed independently by the next lookup, resolver error is EINTR afterwards, invalid arguments do not consume a preserved abort, unknown flags throw, unknown id returns EBADF. A deliberately broken build (abort not consumed) makes the test fail.
  • tools/check_conventions.py --base origin/main passes.
  • Not tested with a title or homebrew.

#1514 edits the same TechnicalDebt line (PPSA23566 list); whichever merges second needs a one-line rebase.

Checklist

  • Based on current main (084aeeb6); no other open PR implements the same functions (all PR heads up to #1518 checked)
  • 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 (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (Claude Code); the author is responsible for every line

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4785103810 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1502). Originally posted by [AcelezXYZ](https://github.com/AcelezXYZ) on 2026-10-08T10:05:23Z. --- ### What Implements `sceNetResolverAbort(rid, flags)` in libSceNet (PPSA23566 imports it). - Flag 0x1 keeps an abort for the next `sceNetResolverStartNtoa`, flag 0x2 for the next `sceNetResolverStartAton`. The preserved abort makes that lookup fail once with `EINTR` (`0x80410104`, errno 4) and sets the resolver error to the same value. - Argument errors are checked before the preserved abort, so an invalid call does not consume it. - Unknown resolver id returns `EBADF`; other flag bits throw. - Lookups are synchronous here, so a lookup already running on another thread is not interrupted. Documented in TechnicalDebt; the function is removed from the PPSA23566 unknown-signature list. Signature, flags and the `EINTR` result follow the shadPS4 reimplementation of the PS4 library (`AbortResolver`/`RunLookup` in `net_resolver.cpp`), not confirmed on a PS5 title. ### Tested - Linux x86-64, GCC 13.3, Release build, full `ctest`: 441/442 pass. The only failure is `guest_sce_net`, which already aborts in `CheckUnspecifiedIpv6` in my sandbox (no IPv6 available), also on unmodified `main`, before the new checks run. - With that one call skipped locally, `guest_sce_net` passes including the new checks: abort without flag has no effect, NTOA and ATON preservation are consumed independently by the next lookup, resolver error is `EINTR` afterwards, invalid arguments do not consume a preserved abort, unknown flags throw, unknown id returns `EBADF`. A deliberately broken build (abort not consumed) makes the test fail. - `tools/check_conventions.py --base origin/main` passes. - Not tested with a title or homebrew. #1514 edits the same TechnicalDebt line (PPSA23566 list); whichever merges second needs a one-line rebase. ### Checklist - [x] Based on current `main` (084aeeb6); no other open PR implements the same functions (all PR heads up to #1518 checked) - [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 (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes ([Claude Code](https://claude.com/claude-code)); the author is responsible for every line 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-08 10:53:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T10:53:38Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#1514 docs/dev/TechnicalDebt.md L58
#1588 core/libs/prx/libSceNet/Export.cpp L1073, L1082-1085, L1109-1112
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6058287030 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1502#issuecomment-6058287030). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T10:53:38Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #1514 | `docs/dev/TechnicalDebt.md` [L58](https://github.com/boykopovar/AnyPS5/blob/4b6ab6bb7371869f85837ff824f409b49f1e8081/docs/dev/TechnicalDebt.md#L58) | | | | #1588 | `core/libs/prx/libSceNet/Export.cpp` [L1073](https://github.com/boykopovar/AnyPS5/blob/4b6ab6bb7371869f85837ff824f409b49f1e8081/core/libs/prx/libSceNet/Export.cpp#L1073), [L1082-1085](https://github.com/boykopovar/AnyPS5/blob/4b6ab6bb7371869f85837ff824f409b49f1e8081/core/libs/prx/libSceNet/Export.cpp#L1082-L1085), [L1109-1112](https://github.com/boykopovar/AnyPS5/blob/4b6ab6bb7371869f85837ff824f409b49f1e8081/core/libs/prx/libSceNet/Export.cpp#L1109-L1112) | | |
klosixgaming-arch commented 2026-10-08 11:28:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T11:28:29Z.

Review: APPROVED


Good implementation of sceNetResolverAbort. This follows shadPS4's approach for the PS4 library and provides proper handling of preservation flags for future lookups.

Strengths:

  • Clean implementation with proper thread-safe state management using mutex
  • Correct handling of preservation flags (NTOA and ATON) that affect subsequent resolver calls
  • Comprehensive test coverage including edge cases (invalid flags, already destroyed resolver, null arguments)
  • Good documentation in TechnicalDebt.md about limitations (synchronous lookups, not confirmed on PS5 title)

Technical notes:

  • The approach of setting a pending abort flag that affects the next lookup is correct for synchronous resolver operations
  • Proper error handling with appropriate errno values (EBADF, EINVAL, EINTR)
  • Test cases properly verify all scenarios including preservation flag behavior and cleanup on destroy

This will improve network compatibility for titles that use DNS resolution with abort functionality. Ready to merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5455842497 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1502#pullrequestreview-5455842497). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-08T11:28:29Z. **Review:** APPROVED --- Good implementation of `sceNetResolverAbort`. This follows shadPS4's approach for the PS4 library and provides proper handling of preservation flags for future lookups. **Strengths:** - Clean implementation with proper thread-safe state management using mutex - Correct handling of preservation flags (NTOA and ATON) that affect subsequent resolver calls - Comprehensive test coverage including edge cases (invalid flags, already destroyed resolver, null arguments) - Good documentation in TechnicalDebt.md about limitations (synchronous lookups, not confirmed on PS5 title) **Technical notes:** - The approach of setting a pending abort flag that affects the next lookup is correct for synchronous resolver operations - Proper error handling with appropriate errno values (EBADF, EINVAL, EINTR) - Test cases properly verify all scenarios including preservation flag behavior and cleanup on destroy This will improve network compatibility for titles that use DNS resolution with abort functionality. Ready to merge.
oneandonlydean commented 2026-10-09 09:29:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:29:19Z.


Closing: PPSA23566 imports sceNetResolverAbort, but no title is shown stopping at it on main. Reopen when it's a title's next stop on main, with the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6078224920 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1502#issuecomment-6078224920). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T09:29:19Z. --- Closing: PPSA23566 imports `sceNetResolverAbort`, but no title is shown stopping at it on main. Reopen when it's a title's next stop on main, with the log line.

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