diff options
| author | Omar Mahboubi <166836773+omar-mahboubi@users.noreply.github.com> | 2026-10-30 15:07:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-30 15:07:40 +0100 |
| commit | 0a778123e9dcdb4a484fac688ee1bf95837b4a34 (patch) | |
| tree | d58327b7d8672b7ceca2b3be7774ed09db3978ee /src | |
| parent | 62de5e8e4c97c3df8c56fb0922631f3af430dacf (diff) | |
| parent | 9e4e58c8e54add0e9909de8a9cba2444d8314ee7 (diff) | |
Merge pull request #32 from givethesourceplox/nx2-open-file-limit
yuzu_cmd: raise the open file limit on macOS and Linux
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 3d9f50d4e5..70fd9090e3 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -4,6 +4,7 @@ // SPDX-FileCopyrightText: 2014 Citra Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include <algorithm> #include <atomic> #include <iterator> #include <fstream> @@ -56,6 +57,10 @@ #include "yuzu_cmd/emu_window/emu_window_sdl3_vk.h" #include "yuzu_cmd/nx2_sampler.h" +#if defined(__unix__) || defined(__APPLE__) +#include <sys/resource.h> +#endif + #ifdef _WIN32 // windows.h needs to be included before shellapi.h #include <windows.h> @@ -262,6 +267,12 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { // Raise the CRT's open-file limit like the Qt frontend: loose RomFS folders keep thousands of // files open through the VFS cache. _setmaxstdio(8192); +#elif defined(__unix__) || defined(__APPLE__) + // Same for the open file limit (macOS shells default to 256). + if (struct rlimit rl; getrlimit(RLIMIT_NOFILE, &rl) == 0) { + rl.rlim_cur = std::min<rlim_t>(8192, rl.rlim_max); + setrlimit(RLIMIT_NOFILE, &rl); + } #endif Common::Log::Initialize(); |
