AnyPS5/core/libs/prx/libSceRudp
David 4029b5d2c9 fix(libSceRudp): swap sceRudpEnd and sceRudpTerminate
sceRudpEnd takes no argument and shuts the library down; sceRudpTerminate
takes a context id and releases that context. main had the two swapped,
so a title calling sceRudpEnd() passed a stray register as a context id
and the library stayed initialised.

Evidence:
- PS5 console measurement by hugodearaujo in #3073 (firmware 13.60):
  "After `sceRudpEnd()` all three return `0x80770001` again"
  (sceRudpGetMaxSegmentSize, sceRudpProcessEvents, sceRudpNetFlush).
- AlexAltea/orbital cc408367da6a6ebbf5ac1ac559fefeadc73b2831
  tools/ida/db_types.json:1971,1996: `int sceRudpEnd(void)`,
  `int sceRudpTerminate(int ctxId)`.
- RPCS3 26098fb42d090cd522b4afcf3b754dd987c82978
  rpcs3/Emu/Cell/Modules/cellRudp.cpp:108: `cellRudpEnd()` tears the
  library down.
- AndnixSH/Vita3K-PS-Vita-OS-Fork c86ac732bc811057e690bed280c5076bdf95385e
  vita3k/modules/SceRudp/SceLibRudp.cpp:1032,1614: `sceRudpEnd()` clears
  every context, `sceRudpTerminate(int ctx_id)` erases one.

The bodies are unchanged, only exchanged. guest_offline_imports now ends
the library with sceRudpEnd(), and guest_rudp_status checks that
sceRudpTerminate releases one context and sceRudpEnd all of them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-13 07:51:20 +00:00
..
Export.cpp fix(libSceRudp): swap sceRudpEnd and sceRudpTerminate 2026-10-13 07:51:20 +00:00