summaryrefslogtreecommitdiff
path: root/libs/ardour/globals.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-12-08 18:38:45 +0100
committerRobin Gareus <robin@gareus.org>2015-12-08 18:39:56 +0100
commit2f5c4c29c6d60b172676a0f79c542d0ff085a9f6 (patch)
tree971e416b023469be4a7015477e517934accee90b /libs/ardour/globals.cc
parent6c995762508a6d7a507e726a742f456a6fa5b2a7 (diff)
2K? that's micro -- use macrosoft for lots a files, please!
Diffstat (limited to 'libs/ardour/globals.cc')
-rw-r--r--libs/ardour/globals.cc16
1 files changed, 16 insertions, 0 deletions
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 <stdio.h> // for _setmaxstdio
#include <windows.h> // 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
}