Disable coredumps by default on Linux + other minor fixes (ryubing/ryujinx!204)

See merge request ryubing/ryujinx!204
This commit is contained in:
Alula
2025-12-04 17:32:26 -06:00
committed by GreemDev
parent d522bfef62
commit b018a44ff0
2 changed files with 45 additions and 6 deletions

View File

@@ -20,5 +20,21 @@ namespace Ryujinx.Common.Utilities
Debug.Assert(res != -1);
}
}
// "dumpable" attribute of the calling process
private const int PR_SET_DUMPABLE = 4;
[DllImport("libc", SetLastError = true)]
private static extern int prctl(int option, int arg2);
public static void SetCoreDumpable(bool dumpable)
{
if (OperatingSystem.IsLinux())
{
int dumpableInt = dumpable ? 1 : 0;
int result = prctl(PR_SET_DUMPABLE, dumpableInt);
Debug.Assert(result == 0);
}
}
}
}