- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
- FD_ZERO(&rds);
- FD_SET(0, &rds);
-
- /* wait up to timeout until anything is avail. for reading on stdin */
- j = select(1, &rds, NULL, NULL, &timeout);
-
- /* error occured */
- if (j == -1) {
- print_helperr(SELECT);
- getch();
- break;
- }
-
- /* not timed out => anything avail. for reading in &rds */
- if (j != 0) {
- j = getc(stdin);
- if (j == 'q' || j == 'Q')
- break;