diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2014-02-10 09:12:35 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2014-02-10 09:12:35 +0000 |
commit | 75f8a2e5a773cdcca333f0743b84ac4145b9fb70 (patch) | |
tree | f1d9ff70e7d9e751ec8f3ca2b421493092412cf9 /usr.sbin/ntpd/ntp_dns.c | |
parent | cb60e22829ef23044dcf046b63e53d0e677b9653 (diff) |
Run the serving and privileged ntpd processes at high priority and the
dns process at normal priority. Should improve latency on loaded machines.
ok henning@
Diffstat (limited to 'usr.sbin/ntpd/ntp_dns.c')
-rw-r--r-- | usr.sbin/ntpd/ntp_dns.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/ntpd/ntp_dns.c b/usr.sbin/ntpd/ntp_dns.c index 44148fe2641..931c25ee5da 100644 --- a/usr.sbin/ntpd/ntp_dns.c +++ b/usr.sbin/ntpd/ntp_dns.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp_dns.c,v 1.4 2013/11/13 20:44:39 benno Exp $ */ +/* $OpenBSD: ntp_dns.c,v 1.5 2014/02/10 09:12:34 dtucker Exp $ */ /* * Copyright (c) 2003-2008 Henning Brauer <henning@openbsd.org> @@ -17,7 +17,10 @@ */ #include <sys/param.h> +#include <sys/resource.h> #include <sys/time.h> + +#include <err.h> #include <errno.h> #include <poll.h> #include <signal.h> @@ -61,6 +64,9 @@ ntp_dns(int pipe_ntp[2], struct ntpd_conf *nconf, struct passwd *pw) return (pid); } + if (setpriority(PRIO_PROCESS, 0, 0) == -1) + warn("could not set priority"); + /* in this case the parent didn't init logging and didn't daemonize */ if (nconf->settime && !nconf->debug) { log_init(nconf->debug); |