mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 21:58:45 +00:00
* Store platform-specific level in a separate variable So the level logged in the getsockopt/setsockopt unreachable is actually useful in cases where the level is unknown. * Define ORBIS_NET_IPPROTO_IPV6 Not implemented yet, but since it's known we might as well add it. * Fix error codes Our libSceNet code expects accurate ORBIS_NET_E* errors, while the sys_net code returns ORBIS_NET_ERROR_* errors. * Remove duplicate getsockname implementation * Use separate mutex for ReceivePacket calls Calls to ReceivePacket shouldn't block other socket functions, and allowing them to block these functions frequently causes deadlocks in games that use multiple threads for socket behaviors. That said, concurrent receives are still a potential issue, so the function should still have a mutex. * Add missing error codes * Clang * Minor nit Not sure why these were left separate from the rest of the net errnos * Set __Error() in ConvertReturnErrorCode Because the new error values are positive, the logic of "negative return is an error" doesn't work anymore. The easiest fix, while retaining corrected error values, is to just set __Error() in ConvertReturnErrorCode, and have that return -1 instead. I also added some formatting fixes here too. * Set errno on stubbed P2P socket error returns. Otherwise the errno is just whatever was set by a previous failing function, which may cause issues in some games. I used EAGAIN here since it appears to be valid for all three of these functions, but this can be changed if requested. * Fix missed error returns * Fix socket methods in file_system Missed these