mirror of
https://git.citron-emu.org/Citron/Citron.git
synced 2025-02-07 08:46:25 +01:00
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:
parent
2e4db14bc1
commit
8c630a8bea
4 changed files with 5 additions and 1 deletions
|
@ -26,6 +26,7 @@ enum class Errno : u32 {
|
||||||
TIMEDOUT = 110,
|
TIMEDOUT = 110,
|
||||||
CONNREFUSED = 111,
|
CONNREFUSED = 111,
|
||||||
INPROGRESS = 115,
|
INPROGRESS = 115,
|
||||||
|
NOMEM = 12,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class GetAddrInfoError : s32 {
|
enum class GetAddrInfoError : s32 {
|
||||||
|
|
|
@ -37,6 +37,8 @@ Errno Translate(Network::Errno value) {
|
||||||
return Errno::CONNRESET;
|
return Errno::CONNRESET;
|
||||||
case Network::Errno::INPROGRESS:
|
case Network::Errno::INPROGRESS:
|
||||||
return Errno::INPROGRESS;
|
return Errno::INPROGRESS;
|
||||||
|
case Network::Errno::NOMEM:
|
||||||
|
return Errno::NOMEM;
|
||||||
default:
|
default:
|
||||||
UNIMPLEMENTED_MSG("Unimplemented errno={}", value);
|
UNIMPLEMENTED_MSG("Unimplemented errno={}", value);
|
||||||
return Errno::SUCCESS;
|
return Errno::SUCCESS;
|
||||||
|
|
|
@ -46,6 +46,7 @@ enum class Errno {
|
||||||
MSGSIZE,
|
MSGSIZE,
|
||||||
INPROGRESS,
|
INPROGRESS,
|
||||||
OTHER,
|
OTHER,
|
||||||
|
NOMEM,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class GetAddrInfoError {
|
enum class GetAddrInfoError {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
|
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
|
||||||
"name": "citron",
|
"name": "citron",
|
||||||
"builtin-baseline": "7adc2e4d49e8d0efc07a369079faa6bc3dbb90f3",
|
"builtin-baseline": "c82f74667287d3dc386bce81e44964370c91a289",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"boost-algorithm",
|
"boost-algorithm",
|
||||||
|
|
Loading…
Reference in a new issue