mlockall(MCL_CURRENT | MCL_FUTURE);
}
-#ifdef __linux__
static int
oom_adjust(const char *file, const char *value)
{
close(fd);
return rc ? -1 : 0;
}
-#endif
void usage(char* errmsg, ...) {
if(errmsg) {
setsizes(nbd, size64, blocksize, flags);
set_timeout(nbd, timeout);
finish_sock(sock, nbd, swap);
-#ifdef __linux__
if (swap) {
/* try linux >= 2.6.36 interface first */
if (oom_adjust("/proc/self/oom_score_adj", "-1000")) {
oom_adjust("/proc/self/oom_adj", "-17");
}
}
-#endif
/* Go daemon */