Листинг Г.5. Обертка Select, обрабатывающая возврат EINTR
//lib/wrapunix.c
313 int
314 Select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
315 struct timeval *timeout)
316 {
317 int n;
318 again:
319 if ( (n = select(nfds, readfds, writefds, exceptfds, timeout)) < 0) {
320 if (errno == EINTR)
321 goto again;
322 else
323 err_sys("select error");
324 } else if (n == 0 && timeout == NULL)
325 err_quit("select returned 0 with no timeout");
326 return(n); /* возвращаем 0 по тайм-ауту */
327 }