From 2f5c4c29c6d60b172676a0f79c542d0ff085a9f6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 8 Dec 2015 18:38:45 +0100 Subject: 2K? that's micro -- use macrosoft for lots a files, please! --- libs/ardour/globals.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libs/ardour/globals.cc') diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 0a1d0cd085..b2ad67d053 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -41,6 +41,7 @@ #include "pbd/gstdio_compat.h" #ifdef PLATFORM_WINDOWS +#include // for _setmaxstdio #include // for LARGE_INTEGER #endif @@ -273,6 +274,21 @@ lotsa_files_please () } else { error << string_compose (_("Could not get system open files limit (%1)"), strerror (errno)) << endmsg; } +#else + /* this only affects stdio. 2048 is the maxium possible (512 the default). + * + * If we want more, we'll have to replaces the POSIX I/O interfaces with + * Win32 API calls (CreateFile, WriteFile, etc) which allows for 16K. + * + * see http://stackoverflow.com/questions/870173/is-there-a-limit-on-number-of-open-files-in-windows + * and http://bugs.mysql.com/bug.php?id=24509 + */ + int newmax = _setmaxstdio (2048); + if (newmax > 0) { + info << string_compose (_("Your system is configured to limit %1 to only %2 open files"), PROGRAM_NAME, newmax) << endmsg; + } else { + error << string_compose (_("Could not set system open files limit. Current limit is %1 open files"), _getmaxstdio) << endmsg; + } #endif } -- cgit v1.2.3