fd_set fds;structtimevaltv;intr;FD_ZERO(&fds);FD_SET(fd, &fds);/* Timeout. */tv.tv_sec =2; tv.tv_usec =0; r =select(fd +1, &fds,NULL,NULL, &tv);if(-1== r) {if(EINTR == errno)continue;errno_exit("select"); }if(0== r) {fprintf(stderr,"select timeout\n");ex...