int readable_timeo(int fd, int sec)
{
fd_set rset;
struct timeval tv; FD_ZERO(&rset);
FD_SET(fd, &rset); tv.tv_sec = sec;
tv.tv_usec = ; return (select(fd+, &rset, NULL, NULL, &tv));
}
int writeable_timeo(int fd, int sec)
{
fd_set wset;
struct timeval tv; FD_ZERO(&rset);
FD_SET(fd, &rset); tv.tv_sec = sec;
tv.tv_usec = ; return (select(fd+, NULL, &wset, NULL, &tv));
}