Now that mlockall(2) is unbroken, use it to keep watchdogd(8) permanently

out of swap.
This commit is contained in:
green 2004-07-23 15:24:57 +00:00
parent 25c9673901
commit 296061987a

View File

@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
#include <sys/rtprio.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/watchdog.h>
#include <err.h>
@ -87,6 +88,9 @@ main(int argc, char *argv[])
if (rtprio(RTP_SET, 0, &rtp) == -1)
err(EX_OSERR, "rtprio");
if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1)
err(EX_OSERR, "mlockall");
if (watchdog_init() == -1)
errx(EX_SOFTWARE, "unable to initialize watchdog");