return sent;
while ((rv = writev(osfd, (const struct iovec*)iov, iov_size)) == -1) { err = sock_errno(); if ((err == SOCEWOULDBLOCK))    { 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; } }   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);
_PR_MD_WRITEV(PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size, PRIntervalTime timeout){    int index;    int sent = 0;    int rv;    for (index=0; index < iov_size; index++)     {        rv = _PR_MD_SEND(fd, iov[index].iov_base, iov[index].iov_len, 0, timeout);        if (rv > 0)             sent += rv;        if ( rv != iov[index].iov_len )         {            if (rv < 0)            {                if (fd->secret->nonblocking                    && (PR_GetError() == PR_WOULD_BLOCK_ERROR)                    && (sent > 0))                {                    return sent;                }                else                {                    return -1;                }            }            /* Only a nonblocking socket can have partial sends */            PR_ASSERT(fd->secret->nonblocking);            return sent;        }    }    return sent;}