| version 1.209.2.2, 2013/02/14 22:13:59 |
version 1.210, 2012/03/16 06:47:37 |
| Line 585 fsocreate(int domain, struct socket **so |
|
| Line 585 fsocreate(int domain, struct socket **so |
|
| fp->f_data = so; |
fp->f_data = so; |
| fd_affix(curproc, fp, fd); |
fd_affix(curproc, fp, fd); |
| *fdout = fd; |
*fdout = fd; |
| if (flags & SOCK_NONBLOCK) |
|
| so->so_state |= SS_NBIO; |
|
| } |
} |
| return error; |
return error; |
| } |
} |
| Line 624 solisten(struct socket *so, int backlog, |
|
| Line 622 solisten(struct socket *so, int backlog, |
|
| if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | |
if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | |
| SS_ISDISCONNECTING)) != 0) { |
SS_ISDISCONNECTING)) != 0) { |
| sounlock(so); |
sounlock(so); |
| return (EOPNOTSUPP); |
return (EINVAL); |
| } |
} |
| error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, NULL, |
error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, NULL, |
| NULL, NULL, l); |
NULL, NULL, l); |
| Line 1134 soreceive(struct socket *so, struct mbuf |
|
| Line 1132 soreceive(struct socket *so, struct mbuf |
|
| { |
{ |
| struct lwp *l = curlwp; |
struct lwp *l = curlwp; |
| struct mbuf *m, **mp, *mt; |
struct mbuf *m, **mp, *mt; |
| size_t len, offset, moff, orig_resid; |
int atomic, flags, len, error, s, offset, moff, type, orig_resid; |
| int atomic, flags, error, s, type; |
|
| const struct protosw *pr; |
const struct protosw *pr; |
| struct mbuf *nextrecord; |
struct mbuf *nextrecord; |
| int mbuf_removed = 0; |
int mbuf_removed = 0; |
| Line 1168 soreceive(struct socket *so, struct mbuf |
|
| Line 1165 soreceive(struct socket *so, struct mbuf |
|
| goto bad; |
goto bad; |
| do { |
do { |
| error = uiomove(mtod(m, void *), |
error = uiomove(mtod(m, void *), |
| MIN(uio->uio_resid, m->m_len), uio); |
(int) min(uio->uio_resid, m->m_len), uio); |
| m = m_free(m); |
m = m_free(m); |
| } while (uio->uio_resid > 0 && error == 0 && m); |
} while (uio->uio_resid > 0 && error == 0 && m); |
| bad: |
bad: |
| Line 1422 soreceive(struct socket *so, struct mbuf |
|
| Line 1419 soreceive(struct socket *so, struct mbuf |
|
| SBLASTMBUFCHK(&so->so_rcv, "soreceive uiomove"); |
SBLASTMBUFCHK(&so->so_rcv, "soreceive uiomove"); |
| sounlock(so); |
sounlock(so); |
| splx(s); |
splx(s); |
| error = uiomove(mtod(m, char *) + moff, len, uio); |
error = uiomove(mtod(m, char *) + moff, (int)len, uio); |
| s = splsoftnet(); |
s = splsoftnet(); |
| solock(so); |
solock(so); |
| if (error != 0) { |
if (error != 0) { |