All pastes #21528 Raw Edit

Something

public c v1 · immutable
#21528 ·published 2005-08-29 19:46 UTC
rendered paste body
int preSend(int fd, int timeout){   fd_set rfds;   struct timeval tv;   int retval;   FD_ZERO(&rfds);   FD_SET(fd, &rfds);   tv.tv_sec = timeout;   tv.tv_usec = 0;   retval = select(fd+1, NULL, &rfds, NULL, &tv);   if(retval == -1){      return -1;   }else if(retval){      return 0;   }else{      return -1;   }}