[Olsr-users] Broadcast Packets & Windows Routin

Juliusz Chroboczek (spam-protected)
Thu Mar 13 19:02:37 CET 2008


>> According to the man page of select(2):

>> "The select function may update the timeout parameter to indicate 
>> how much time was left."

>> What worries me here is the word "may". It would be quite useful
>> to know the time left. But that is a worry for the implementor.

No, don't do that, it's not portable and error-prone.  Just call
gettimeofday before and after select, and subtract the two.

(If you *really* want to be correct, call clock_gettime(CLOCK_MONOTONIC),
but that's not portable.)

> BTW the select(2) sys-call is dying out and now sometimes just a wrapper
> (e.g. in the GNU-libc) function of poll(2).

I believe you are wrong.  Select is a native system call (it doesn't
call poll) on both Linux and BSD-derived systems.

                                        Juliusz




More information about the Olsr-users mailing list