From f145c771fb7b377425ee1185395c3c65ec529063 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Sun, 26 Sep 2010 01:45:33 +0000 Subject: Protect the watchdog daemon against swap OOM killer. This is similar to SVN r199804 which added protection to sshd, cron, syslogd, and inetd. --- usr.sbin/watchdogd/watchdogd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'usr.sbin/watchdogd/watchdogd.c') diff --git a/usr.sbin/watchdogd/watchdogd.c b/usr.sbin/watchdogd/watchdogd.c index 4b58caf3889e..7bae4ffc3ee4 100644 --- a/usr.sbin/watchdogd/watchdogd.c +++ b/usr.sbin/watchdogd/watchdogd.c @@ -31,6 +31,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -115,6 +116,8 @@ main(int argc, char *argv[]) signal(SIGTERM, sighandler); pidfile_write(pfh); + if (madvise(0, 0, MADV_PROTECT) != 0) + warn("madvise failed"); watchdog_loop(); -- cgit v1.2.3