summaryrefslogtreecommitdiffstats
path: root/lib/libc/resolv/res_private.h
diff options
context:
space:
mode:
authorvangyzen <vangyzen@FreeBSD.org>2015-12-19 02:41:31 +0000
committervangyzen <vangyzen@FreeBSD.org>2015-12-19 02:41:31 +0000
commitb6f246520d532d80d0838a3b005db8ef8e9e9a47 (patch)
tree83f00a984fb131904f8621162a28cdfffaa7e50e /lib/libc/resolv/res_private.h
parentec40565958ba8acbc1f4b137261df32c9fc37568 (diff)
downloadFreeBSD-src-b6f246520d532d80d0838a3b005db8ef8e9e9a47.zip
FreeBSD-src-b6f246520d532d80d0838a3b005db8ef8e9e9a47.tar.gz
MFC r289315, r292216
resolver: automatically reload /etc/resolv.conf On each resolver query, use stat(2) to see if the modification time of /etc/resolv.conf has changed. If so, reload the file and reinitialize the resolver library. However, only call stat(2) if at least two seconds have passed since the last call to stat(2), since calling it on every query could kill performance. This new behavior is enabled by default. Add a "reload-period" option to disable it or change the period of the test. Document this behavior and option in resolv.conf(5). Polish the man page just enough to appease igor. Relnotes: yes Sponsored by: Dell Inc.
Diffstat (limited to 'lib/libc/resolv/res_private.h')
-rw-r--r--lib/libc/resolv/res_private.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libc/resolv/res_private.h b/lib/libc/resolv/res_private.h
index 4e98157..a986e95 100644
--- a/lib/libc/resolv/res_private.h
+++ b/lib/libc/resolv/res_private.h
@@ -1,3 +1,5 @@
+/* $FreeBSD$ */
+
#ifndef res_private_h
#define res_private_h
@@ -12,6 +14,9 @@ struct __res_state_ext {
} sort_list[MAXRESOLVSORT];
char nsuffix[64];
char nsuffix2[64];
+ struct timespec conf_mtim; /* mod time of loaded resolv.conf */
+ time_t conf_stat; /* time of last stat(resolv.conf) */
+ u_short reload_period; /* seconds between stat(resolv.conf) */
};
extern int
OpenPOWER on IntegriCloud