From 35d91a0e58cb0b2916b7a4f138c63fcc12b71112 Mon Sep 17 00:00:00 2001 From: TSRBerry <20988865+TSRBerry@users.noreply.github.com> Date: Tue, 30 May 2023 01:48:37 +0200 Subject: Linux: Automatically increase vm.max_map_count if it's too low (#4702) * memory: Check results of pinvoke calls * Increase vm.max_map_count when running Ryujinx * Add SupportedOSPlatform attribute for WindowsApiException * Revert increasing vm.max_map_count via script * Add LinuxHelper to detect and increase vm.max_map_count With GUI dialogs, this should be a bit more user-friendly. * Supply arguments as a list to RunPkExec * Add error logging in case RunPkExec() fails * Prevent Gtk from crashing --- src/Ryujinx.Memory/MemoryManagerUnixHelper.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Ryujinx.Memory/MemoryManagerUnixHelper.cs') diff --git a/src/Ryujinx.Memory/MemoryManagerUnixHelper.cs b/src/Ryujinx.Memory/MemoryManagerUnixHelper.cs index 204f1ca4..a7b207ab 100644 --- a/src/Ryujinx.Memory/MemoryManagerUnixHelper.cs +++ b/src/Ryujinx.Memory/MemoryManagerUnixHelper.cs @@ -1,8 +1,11 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.Versioning; namespace Ryujinx.Memory { + [SupportedOSPlatform("linux")] + [SupportedOSPlatform("macos")] public static partial class MemoryManagerUnixHelper { [Flags] @@ -41,6 +44,8 @@ namespace Ryujinx.Memory O_SYNC = 256, } + public const IntPtr MAP_FAILED = -1; + private const int MAP_ANONYMOUS_LINUX_GENERIC = 0x20; private const int MAP_NORESERVE_LINUX_GENERIC = 0x4000; private const int MAP_UNLOCKED_LINUX_GENERIC = 0x80000; -- cgit v1.2.3