My program must detect when an ethernet interface turn to RUNNING
state.
I can poll the running flag by using ioctl()
:
if( ioctl( dummy_fd, SIOCGIFFLAGS, &ifr ) != -1 )
return ifr.ifr_flags & IFF_RUNNING;
But want the information immediately without polling. Currently the program uses select()
for waiting other events. So it would be nice to use select()
for detecting state changes of interfaces.
There is a way to do it with select
, I did read about that from net. But I don't find that page anymore.