Subject: Re: reloading /etc/resolv.conf
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: Perry E. Metzger <perry@piermont.com>
List: netbsd-help
Date: 02/26/2003 11:33:04
Jason R Thorpe <thorpej@wasabisystems.com> writes:
> On Wed, Feb 26, 2003 at 10:23:55AM -0500, Perry E. Metzger wrote:
>  > It would be nice to fix this someday. A kqueue listening on the
>  > /etc/resolv.conf file would do it nicely without having to poll.
> 
> I suspect you don't understand how the kqueue API works.  You do, in fact,
> have to poll for the events by calling the kevent(2) system call.
> 
> So, if you have to make a system call *anyway*, you might as well just
> use stat(2).

Not everything operates that way. In particular, more and more of our
programs are event driven and block in select, poll, or kevent anyway,
waiting for I/O or other events. Under such circumstances, checking
for changes to resolv.conf is free.

However, anything using the normal libraries isn't likely to win this
way anyway, so perhaps the stat is indeed as cheap...


-- 
Perry E. Metzger		perry@piermont.com