MCPcopy Create free account
hub / github.com/citp/BlockSci / checkOpenFilesLimit

Method checkOpenFilesLimit

tools/parser/doctor.cpp:153–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void BlockSciDoctor::checkOpenFilesLimit() {
154 struct rlimit rlim;
155 getrlimit(RLIMIT_NOFILE, &rlim);
156 rlim_t openFileLimit = rlim.rlim_cur;
157 if(openFileLimit < MIN_OPEN_FILES) {
158 std::stringstream ss;
159 ss << "Open files limit of " << openFileLimit << " is potentially too low. This could lead to data corruption.";
160 printWarning(ss.str());
161 warnings += 1;
162 } else {
163 std::stringstream ss;
164 ss << "Open files limit of " << openFileLimit << ".";
165 printOk(ss.str());
166 }
167}
168
169void BlockSciDoctor::printResults() {
170 if(warnings + errors > 0) {

Callers 1

mainFunction · 0.80

Calls 2

printWarningFunction · 0.85
printOkFunction · 0.85

Tested by

no test coverage detected