Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there not some required library we should tell gcc to use while linking so that select can manage time?

0
Posted

Is there not some required library we should tell gcc to use while linking so that select can manage time?

0

The headers you need for select are outlined in the manual. Try “man select” and you will find everything you need. Note that when using a timeout in select, Linux will change the time structure to reflect the remaining amount of time. For example, I tell select to timeout after 60 seconds, but select returns after 40 seconds. The time structure I handed it will now read 20 seconds. This behavior is system-dependant and your code should not rely on it. To ensure portability, you should check the current time using gettimeofday() and then, as the manual page suggests, reset the time structure before each call.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.