11 input_timeout (int filedes
, unsigned int seconds
)
14 struct timeval timeout
;
17 /* Initialize the file descriptor set. */
19 FD_SET (filedes
, &set
);
21 /* Initialize the timeout data structure. */
22 timeout
.tv_sec
= seconds
;
26 /* @code{select} returns 0 if timeout, 1 if input available, -1 if error. */
27 return TEMP_FAILURE_RETRY (select (FD_SETSIZE
,
37 fprintf (stderr
, "select returned %d.\n",
38 input_timeout (STDIN_FILENO
, 5));