rem: int i;
add: uint32 i;
context: int socket_send(struct socket *so, struct msghdr *mp, int flags, int *retsize){	struct uio auio;	struct iovec *iov;	int i;	struct mbuf *to;	struct mbuf *control;	int len;	int error;	auio.uio_iov = mp->msg_iov;	auio.uio_iovcnt = mp->msg_iovlen;	auio.uio_segflg = UIO_USERSPACE;	auio.uio_rw = UIO_WRITE;	auio.uio_offset = 0;	auio.uio_resid = 0;	iov = mp->msg_iov;	/* Make sure we don't exceed max size... */	for (i=0;i < mp->msg_iovlen;i++, iov++) {		if (iov->iov_len > SSIZE_MAX ||		    (auio.uio_resid += iov->iov_len) > SSIZE_MAX)			return EINVAL;	}	if (mp->msg_name) {		/* stick msg_name into an mbuf */		to = m_get(MT_SONAME);		to->m_len = mp->msg_namelen;		memcpy(mtod(to, char*), mp->msg_name, mp->msg_namelen);	} else		to = NULL;		if (mp->msg_control) {		if (mp->msg_controllen < sizeof(struct cmsghdr)) {			error = EINVAL;			goto bad;		}		control = m_get(MT_CONTROL);		control->m_len = mp->msg_controllen;		memcpy(mtod(control, char*), mp->msg_control, mp->msg_controllen);	} else		control = NULL;	len = auio.uio_resid;	error = sosend(so, to, &auio, NULL, control, flags);	if (error) {		/* what went wrong! */		if (auio.uio_resid != len && (/*error == ERESTART || */		    error == EINTR || error == EWOULDBLOCK))			error = 0; /* not really an error */	}	if (error == 0)		*retsize = len - auio.uio_resid; /* tell them how much we did send */bad:	if (to)		m_freem(to);	return error;}