summaryrefslogtreecommitdiffstats
path: root/usr.sbin/watchdogd/watchdogd.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2004-07-23 15:24:57 +0000
committergreen <green@FreeBSD.org>2004-07-23 15:24:57 +0000
commit296061987ab879478b4a451e688978307546501c (patch)
tree6d346f5f265dcff1ba53262809d4ae3431b7ea86 /usr.sbin/watchdogd/watchdogd.c
parent25c9673901fcf798dd537a4027e13107c0e83944 (diff)
downloadFreeBSD-src-296061987ab879478b4a451e688978307546501c.zip
FreeBSD-src-296061987ab879478b4a451e688978307546501c.tar.gz
Now that mlockall(2) is unbroken, use it to keep watchdogd(8) permanently
out of swap.
Diffstat (limited to 'usr.sbin/watchdogd/watchdogd.c')
-rw-r--r--usr.sbin/watchdogd/watchdogd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/watchdogd/watchdogd.c b/usr.sbin/watchdogd/watchdogd.c
index 0c1b625..298d39e 100644
--- a/usr.sbin/watchdogd/watchdogd.c
+++ b/usr.sbin/watchdogd/watchdogd.c
@@ -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");
OpenPOWER on IntegriCloud