Changeset View
Changeset View
Standalone View
Standalone View
src/util/system.cpp
Show First 20 Lines • Show All 1,163 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* This function tries to raise the file descriptor limit to the requested | * This function tries to raise the file descriptor limit to the requested | ||||
* number. It returns the actual file descriptor limit (which may be more or | * number. It returns the actual file descriptor limit (which may be more or | ||||
* less than nMinFD) | * less than nMinFD) | ||||
*/ | */ | ||||
int RaiseFileDescriptorLimit(int nMinFD) { | int RaiseFileDescriptorLimit(int nMinFD) { | ||||
#if defined(WIN32) | #if defined(WIN32) | ||||
return 2048; | return 8192; | ||||
#else | #else | ||||
struct rlimit limitFD; | struct rlimit limitFD; | ||||
if (getrlimit(RLIMIT_NOFILE, &limitFD) != -1) { | if (getrlimit(RLIMIT_NOFILE, &limitFD) != -1) { | ||||
if (limitFD.rlim_cur < (rlim_t)nMinFD) { | if (limitFD.rlim_cur < (rlim_t)nMinFD) { | ||||
limitFD.rlim_cur = nMinFD; | limitFD.rlim_cur = nMinFD; | ||||
if (limitFD.rlim_cur > limitFD.rlim_max) { | if (limitFD.rlim_cur > limitFD.rlim_max) { | ||||
limitFD.rlim_cur = limitFD.rlim_max; | limitFD.rlim_cur = limitFD.rlim_max; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines |