Module Name: src Committed By: christos Date: Wed Nov 13 23:58:51 UTC 2013
Modified Files: src/lib/libc/net: resolver.3 Log Message: PR/48379: mention kqueue functionality To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/lib/libc/net/resolver.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/net/resolver.3 diff -u src/lib/libc/net/resolver.3:1.26 src/lib/libc/net/resolver.3:1.27 --- src/lib/libc/net/resolver.3:1.26 Wed May 8 14:18:32 2013 +++ src/lib/libc/net/resolver.3 Wed Nov 13 18:58:51 2013 @@ -1,4 +1,4 @@ -.\" $NetBSD: resolver.3,v 1.26 2013/05/08 18:18:32 wiz Exp $ +.\" $NetBSD: resolver.3,v 1.27 2013/11/13 23:58:51 christos Exp $ .\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") .\" .\" Permission to use, copy, modify, and distribute this software for any @@ -33,7 +33,7 @@ .\" @(#)resolver.3 6.5 (Berkeley) 6/23/90 .\" Id: resolver.man3,v 1.2 2009/01/21 00:12:34 each Exp .\" -.Dd May 8, 2013 +.Dd November 13, 2013 .Dt RESOLVER 3 .Os .Sh NAME @@ -364,6 +364,26 @@ environment variable is explained in Initialization normally occurs on the first call to one of the other resolver routines. .Pp +In +.Nx +the initialization code also sets up a +.Xr kqueue 2 +and creates a +.Xr kevent 2 +watching a file descriptor that points to the resolver file. +Every resolver function, calls the internal function +.Fn __res_check +which checks for a new +.Xr kevent 2 +related to the +.Xr resolv.conf 5 +file, and reloads the file if necessary. +This does not work if the file is accessed through a symlink and the symlink +changes to point to a different file. +To fix the symlink issue one could add a system call per resolver call to +get the current time, and reload every so often. +This is not done currently, but it is under consideration. +.Pp The memory referred to by .Ft statp must be set to all zeros prior to the first call to