[ntp:hackers] Correctly detecting interfaces

Hal Murray hmurray at megapathdsl.net
Fri Jul 12 18:40:46 UTC 2013

brian.utterback at oracle.com said:
> Rather than rewrite every instance of calling ioctl to include a test  for
> EINTR and loop to try again, I wrote a new function (isc_ioctl)  which is
> simply a wrapper function around the regular ioctl call. This  wrapper
> function incorporates such a test and loop. I used a "three  strikes and
> you're out" rule, but any number could be used. Probably two  tries is
> really enough, since the interrupt could come anytime after the  ioctl is
> called the first time, but a second failure would imply that  the call is
> taking more than one second to complete and it might never  complete without
> an interrupt if that state is persistent.

Where did one second come from?

I could easily imagine a burst of failures caused by a burst of packets.  All 
it would take would be a nasty combination of router (say WiFi) that happened 
to get the timing just right to match a CPU with the right speed.

These are my opinions.  I hate spam.

More information about the hackers mailing list