[ntp:hackers] Replacing the sigsuspend()/sigpause() by select() with timeout

Danny Mayer mayer at ntp.isc.org
Tue Apr 8 02:33:29 UTC 2008


Martin Burnicki wrote:
> Hi all,
> 
> I'm currently planning to replace the sigsuspend()/sigpause() calls in
> ntp_intres() by a select() call with a timeout according to the
> suspend/pause/sleep interval.
> 
> The select() call shall wait on the read fd of a pipe, so the parent
> process can write to that pipe in order to wake up the forked process
> which runs ntp_intres.
> 
> This is to let the parent process initiate an immediate retry of DNS
> resolution when it has been unseccessful before but then the new
> interface scanning code has found a new interface.
> 
> For details of the underlying problem see the discussion in bug #987:
> http://bugs.ntp.org/show_bug.cgi?id=987
> 
> Are there any concerns about replacing the sigsuspend()/sigpause() by a
> select() with the same timeout?
> 
> I wonder why sigsuspend()/sigpause() is being used here instead of a
> simple sleep().
> 
> Martin

I think that Frank implemented that. Have you asked him about this? I 
think that using sigsuspend()/sigpause() allows you to wake it up while 
sleep() will always sleep until the timeout or did I misunderstand?

Danny


More information about the hackers mailing list