#define MAXSOCK 10 int readfds[ MAXSOCK+1], /* sockets to select from*/ i, j; for(i = 0, j = 0; i << MAXSOCK; i++) if((svc_fdset[i].sockname != 0) && (svc_ fdset[i].sockname != -1)) readfds[j++] = svc_fdset[i].sockname; readfds[j] = 0; /* list of sockets ends with a zero */ switch(select(0, readfds, 0, 0, 0)) { case -1: /* an error happened */ case 0: /* time out */ break; default: /* 1 or more sockets ready for reading */ errno = 0; svc_getreqset(readfds); if( errno == ENETDOWN || errno == ENOTCONN) sys$exit( SS$_THIRDPARTY); }