network: Add NOMEM errno handling for socket operations

Implements support for ENOMEM (errno 12) across the network stack:
- Added NOMEM to Network::Errno enum
- Added NOMEM = 12 to sockets Errno enum
- Added translation case in sockets_translate.cpp

This is the first step towards addressing the 0.0 FPS bug that occurs
when the system runs out of memory during socket operations. Previously,
these operations would trigger an unimplemented assertion, causing the
emulator to halt. Now the error will be properly propagated to the guest
application.
This commit is contained in:
Zephyron 2025-01-28 16:20:54 +10:00
parent 2e4db14bc1
commit 8c630a8bea
No known key found for this signature in database
GPG key ID: 2177ADED8AC966AF
4 changed files with 5 additions and 1 deletions

View file

@ -26,6 +26,7 @@ enum class Errno : u32 {
TIMEDOUT = 110,
CONNREFUSED = 111,
INPROGRESS = 115,
NOMEM = 12,
};
enum class GetAddrInfoError : s32 {

View file

@ -37,6 +37,8 @@ Errno Translate(Network::Errno value) {
return Errno::CONNRESET;
case Network::Errno::INPROGRESS:
return Errno::INPROGRESS;
case Network::Errno::NOMEM:
return Errno::NOMEM;
default:
UNIMPLEMENTED_MSG("Unimplemented errno={}", value);
return Errno::SUCCESS;

View file

@ -46,6 +46,7 @@ enum class Errno {
MSGSIZE,
INPROGRESS,
OTHER,
NOMEM,
};
enum class GetAddrInfoError {

View file

@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "citron",
"builtin-baseline": "7adc2e4d49e8d0efc07a369079faa6bc3dbb90f3",
"builtin-baseline": "c82f74667287d3dc386bce81e44964370c91a289",
"version": "1.0",
"dependencies": [
"boost-algorithm",