mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-09 23:25:43 +01:00
try some alternate, hard numbers when resetting open file limits on OS X
This commit is contained in:
parent
83e3d7c274
commit
b91c7836de
1 changed files with 23 additions and 0 deletions
|
|
@ -218,7 +218,30 @@ lotsa_files_please ()
|
|||
|
||||
if (setrlimit (RLIMIT_NOFILE, &rl) != 0) {
|
||||
if (rl.rlim_cur == RLIM_INFINITY) {
|
||||
#if __APPLE__
|
||||
/* For some reason, Apple doesn't do this the
|
||||
* same way as Linux, and asking for
|
||||
* RLIM_INFINITY even though that is
|
||||
* rl.rlim_cur doesn't work.
|
||||
*
|
||||
* So try some actual large numbers in the hope
|
||||
* that one of them will work.
|
||||
*/
|
||||
|
||||
rl.rlim_cur = 10000;
|
||||
if (setrlimit (RLIMIT_NOFILE, &rl) != 0) {
|
||||
rl.rlim_cur = 4096;
|
||||
if (setrlimit (RLIMIT_NOFILE, &rl) != 0) {
|
||||
rl.rlim_cur = 1000;
|
||||
if (setrlimit (RLIMIT_NOFILE, &rl) != 0) {
|
||||
error << _("Could not set system open files limit to a reasonable value. Be careful!") << endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
info << string_compose ("Configured system open file limit to %1", rl.rlim_cur) << endmsg;
|
||||
#else
|
||||
error << _("Could not set system open files limit to \"unlimited\"") << endmsg;
|
||||
#endif
|
||||
} else {
|
||||
error << string_compose (_("Could not set system open files limit to %1"), rl.rlim_cur) << endmsg;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue