if (!socks) return NULL;
nsPSMShimSelect(CMTSocket *socks, int numsocks, int poll){    CMSocket       **sockArr = (CMSocket **)socks;    PRPollDesc       readPDs[NSPSMSHIMMAXFD];    PRIntervalTime   timeout;    PRInt32          cnt;    int              i;    memset(readPDs, 0, sizeof(readPDs));    PR_ASSERT(NSPSMSHIMMAXFD >= numsocks);    for (i=0; i<numsocks; i++)    {        readPDs[i].fd       = sockArr[i]->fd;        readPDs[i].in_flags = PR_POLL_READ;    }    timeout = poll ? PR_INTERVAL_NO_WAIT : PR_INTERVAL_NO_TIMEOUT;    cnt = PR_Poll(readPDs, numsocks, timeout);    /* Figure out which socket was selected */    if (cnt > 0)    {        for (i=0; i<numsocks; i++)        {            if (readPDs[i].out_flags & PR_POLL_READ)            {            return (CMTSocket)sockArr[i];            }        }    }    return NULL;}