Browse Source

Fix #34: use ~75% of max open file descs

master
Arun Prakash Jana 7 years ago
parent
commit
16f0054b48
No known key found for this signature in database GPG Key ID: A75979F35C080412
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      nnn.c

+ 2
- 4
nnn.c View File

@@ -245,11 +245,9 @@ max_openfds()
limit = rl.rlim_cur;
rl.rlim_cur = rl.rlim_max;

/* Return ~75% of max possible */
if (setrlimit(RLIMIT_NOFILE, &rl) == 0)
return rl.rlim_max - 64;

if (limit > 128)
return limit - 64;
return (rl.rlim_max - (rl.rlim_max >> 2));

return 32;
}


Loading…
Cancel
Save