Skip to content

fix(libSceNet): map every host socket error through the guest errno table - #8589

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
xXPBSXx:fix/scenet-host-errno-table
Oct 20, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
xXPBSXx:fix/scenet-host-errno-table

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What

net_error in core/libs/prx/libSceNet/Export.cpp translated 21 host socket errors and returned EIO (5) for every other one (both the Windows and the POSIX variant). It now returns GuestSockets::GuestErrorFromHost(code), the complete FreeBSD errno table libkernel already uses for its own sockets (libkernel/Socket/include/SocketError.hpp). The 21 mapped errors keep their values.

Why

Errors such as WSAEPROTONOSUPPORT, WSAEPROTOTYPE, WSAEDESTADDRREQ, WSAENOPROTOOPT, WSAEFAULT, WSAENETDOWN, WSAEHOSTDOWN and WSAEMFILE reached the guest as SCE_NET_ERROR_EIO. The numbers are FreeBSD 11 errno.h (43, 41, 39, 42, 14, 50, 64, 24), the same table libkernel's socket() path uses.

Tested

Windows 10 19045, WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON:

Supersedes the approach of closed #4989; the table is reused, not copied.

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; no silent stubs added
  • 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
  • Fixes: none (supersedes the approach of closed fix(libSceNet): report the FreeBSD errno of every host socket error #4989)
  • Unblocks: none
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

…able

sceNet translated only 21 host socket errors and reported every other one
as EIO. libkernel already owns the complete FreeBSD table in
GuestSockets::GuestErrorFromHost, so use it for net_error. The new check
makes a stream socket with the UDP protocol fail with EPROTONOSUPPORT (43)
instead of EIO (5).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@oneandonlydean
oneandonlydean merged commit 86c1784 into boykopovar:main Oct 20, 2026
13 checks passed
@github-actions

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5836 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
PR 6044 core/libs/tests/GuestSceNet.cpp
PR 7201 core/libs/prx/libSceNet/Export.cpp
PR 8204 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp

iamthehimansh added a commit to iamthehimansh/AnyPS5 that referenced this pull request Oct 20, 2026
macOS: sceNetSocket maps EPROTOTYPE from a mismatched type/protocol pair to NET_EPROTONOSUPPORT. Darwin's socket() reports EPROTOTYPE (41) for e.g. AF_INET/SOCK_STREAM/IPPROTO_UDP, while FreeBSD (the PS5) and Linux report EPROTONOSUPPORT (43); upstream boykopovar#8589's new CheckSocketHostErrors expects 43. Linux/Windows keep the upstream path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants