W
William
For the following code snippet:
for ( ;; ) {
numFDInSet = select( fdmax+1, &readfds, NULL, NULL, &tv );
// ...
signal( SIGALRM, alarm_handler );
// ...
ualarm( waitPeriod * 1000, 0 );
}
The problem being if the alarm goes off when select() is scanning the
FD_SET, select is interruped with the following error:
Error on select(): Interrupted system call
Ideally, when the alarm goes off, I would still want select() to continue
scanning the FD_SET and the "main loop" to continue ( select() is inside
the main loop ). Any suggestions to achieving achieving this is
appreicated.
for ( ;; ) {
numFDInSet = select( fdmax+1, &readfds, NULL, NULL, &tv );
// ...
signal( SIGALRM, alarm_handler );
// ...
ualarm( waitPeriod * 1000, 0 );
}
The problem being if the alarm goes off when select() is scanning the
FD_SET, select is interruped with the following error:
Error on select(): Interrupted system call
Ideally, when the alarm goes off, I would still want select() to continue
scanning the FD_SET and the "main loop" to continue ( select() is inside
the main loop ). Any suggestions to achieving achieving this is
appreicated.