+ gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
+ /* make sure we can't have more than FD_SETSIZE files open (event.c does
+ * check but this provides an additional line of defence) */
+ if(getrlimit(RLIMIT_NOFILE, rl) < 0)
+ disorder_fatal(errno, "getrlimit RLIMIT_NOFILE");
+ if(rl->rlim_cur > FD_SETSIZE) {
+ rl->rlim_cur = FD_SETSIZE;
+ if(setrlimit(RLIMIT_NOFILE, rl) < 0)
+ disorder_fatal(errno, "setrlimit to reduce RLIMIT_NOFILE to %lu",
+ (unsigned long)rl->rlim_cur);
+ disorder_info("set RLIM_NOFILE to %lu", (unsigned long)rl->rlim_cur);
+ } else
+ disorder_info("RLIM_NOFILE is %lu", (unsigned long)rl->rlim_cur);