Disable coredumps by default on Linux

This commit is contained in:
Alula
2025-12-04 20:04:34 -06:00
committed by KeatonTheBot
parent 8c99b90926
commit 5a53d36992
2 changed files with 40 additions and 2 deletions
+16
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);
}
}
}
}