while ((rv = writev(osfd, (const struct iovec*)iov, iov_size)) == -1) {
while ((rv = so_writev(osfd, (const struct iovec*)iov, iov_size)) == -1) {
_PR_MD_WRITEV(PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size,              PRIntervalTime timeout){    PRInt32 rv, err;    PRThread *me = _PR_MD_CURRENT_THREAD();    PRInt32 index, amount = 0;    PRInt32 osfd = fd->secret->md.osfd;     /*      * Calculate the total number of bytes to be sent; needed for      * optimization later.      * We could avoid this if this number was passed in; but it is      * probably not a big deal because iov_size is usually small (less than      * 3)      */    if (!fd->secret->nonblocking) {        for (index=0; index<iov_size; index++) {            amount += iov[index].iov_len;        }    }    while ((rv = writev(osfd, (const struct iovec*)iov, iov_size)) == -1) {        err = sock_errno();        if ((err == EWOULDBLOCK))    {            if (fd->secret->nonblocking) {                break;            }            if ((rv = socket_io_wait(osfd, WRITE_FD, timeout))<0)                goto done;        } else if ((err == EINTR) && (!_PR_PENDING_INTERRUPT(me))){            continue;        } else {            break;        }    }     /*      * optimization; if bytes sent is less than "amount" call      * select before returning. This is because it is likely that      * the next writev() call will return EWOULDBLOCK.      */    if ((!fd->secret->nonblocking) && (rv > 0) && (rv < amount)          && (timeout != PR_INTERVAL_NO_WAIT)) {        if (socket_io_wait(osfd, WRITE_FD, timeout) < 0) {            rv = -1;            goto done;        }    }    if (rv < 0) {        _PR_MD_MAP_WRITEV_ERROR(err);    }done:    return(rv);}