I want to use the function select()
to wait 1 second, since my program uses signals to manage things, so it sleep()
will return prematurely. The strange thing is that when used, select()
it also returns prematurely.
I call select like this
struct timeval timeout;
timeout.tv_sec = 10;
timeout.tv_usec = 1000000;
select (0 ,NULL, NULL, NULL, &timeout);
but whenever a signal comes in, it returns (I use a nano stopwatch for the signal)
Does anyone know why?
source
share