Implement ORBIS_NET_SO_ERROR_EX in GetSocketOptions (#3365)

This commit is contained in:
kalaposfos13
2025-08-21 03:36:08 +02:00
committed by GitHub
parent a166e0c2e9
commit 8e8f359b56

View File

@@ -410,6 +410,18 @@ int PosixSocket::GetSocketOptions(int level, int optname, void* optval, u32* opt
CASE_GETSOCKOPT_VALUE(ORBIS_NET_SO_USESIGNATURE, sockopt_so_usesignature);
CASE_GETSOCKOPT_VALUE(ORBIS_NET_SO_NAME,
(char)0); // writes an empty string to the output buffer
case ORBIS_NET_SO_ERROR_EX: {
socklen_t optlen_temp = *optlen;
auto retval = ConvertReturnErrorCode(
getsockopt(sock, level, SO_ERROR, (char*)optval, &optlen_temp));
*optlen = optlen_temp;
if (retval < 0) {
s32 r = *Libraries::Kernel::__Error();
*Libraries::Kernel::__Error() = 0;
return r;
}
return retval;
}
}
} else if (native_level == IPPROTO_IP) {
switch (optname) {