This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: select() blocks


Hi,

> I have this select() call:
>
>            ret = select(serial->fd+1, &rfds, NULL, NULL, &tv_timeout);

might be obvious, but be sure to always reset tv_timeout to your desired timeout befure running select().
tv_timeout might be modified by select(), so when invoking it multiple times or in a loop, you need to reset tv_timeout every time.
I once ran into a similar issue where I simply forgot to reset its value.

Best Regards,

Patrick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]