| version 1.83, 2003/06/29 22:31:30 |
version 1.83.2.1, 2003/07/02 15:26:44 |
| Line 311 sosend_loan(struct socket *so, struct ui |
|
| Line 311 sosend_loan(struct socket *so, struct ui |
|
| if (lva == 0) |
if (lva == 0) |
| return 0; |
return 0; |
| |
|
| error = uvm_loan(&uio->uio_procp->p_vmspace->vm_map, sva, len, |
error = uvm_loan(&uio->uio_lwp->l_proc->p_vmspace->vm_map, sva, len, |
| m->m_ext.ext_pgs, UVM_LOAN_TOPAGE); |
m->m_ext.ext_pgs, UVM_LOAN_TOPAGE); |
| if (error) { |
if (error) { |
| sokvafree(lva, len); |
sokvafree(lva, len); |
| Line 382 socreate(int dom, struct socket **aso, i |
|
| Line 382 socreate(int dom, struct socket **aso, i |
|
| if (p != 0) |
if (p != 0) |
| so->so_uid = p->p_ucred->cr_uid; |
so->so_uid = p->p_ucred->cr_uid; |
| error = (*prp->pr_usrreq)(so, PRU_ATTACH, (struct mbuf *)0, |
error = (*prp->pr_usrreq)(so, PRU_ATTACH, (struct mbuf *)0, |
| (struct mbuf *)(long)proto, (struct mbuf *)0, p); |
(struct mbuf *)(long)proto, (struct mbuf *)0, curlwp); /* XXX */ |
| if (error) { |
if (error) { |
| so->so_state |= SS_NOFDREF; |
so->so_state |= SS_NOFDREF; |
| sofree(so); |
sofree(so); |
| Line 395 socreate(int dom, struct socket **aso, i |
|
| Line 395 socreate(int dom, struct socket **aso, i |
|
| } |
} |
| |
|
| int |
int |
| sobind(struct socket *so, struct mbuf *nam, struct proc *p) |
sobind(struct socket *so, struct mbuf *nam, struct lwp *l) |
| { |
{ |
| int s, error; |
int s, error; |
| |
|
| s = splsoftnet(); |
s = splsoftnet(); |
| error = (*so->so_proto->pr_usrreq)(so, PRU_BIND, (struct mbuf *)0, |
error = (*so->so_proto->pr_usrreq)(so, PRU_BIND, (struct mbuf *)0, |
| nam, (struct mbuf *)0, p); |
nam, (struct mbuf *)0, l); |
| splx(s); |
splx(s); |
| return (error); |
return (error); |
| } |
} |
| Line 413 solisten(struct socket *so, int backlog) |
|
| Line 413 solisten(struct socket *so, int backlog) |
|
| |
|
| s = splsoftnet(); |
s = splsoftnet(); |
| error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, (struct mbuf *)0, |
error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, (struct mbuf *)0, |
| (struct mbuf *)0, (struct mbuf *)0, (struct proc *)0); |
(struct mbuf *)0, (struct mbuf *)0, (struct lwp *)0); |
| if (error) { |
if (error) { |
| splx(s); |
splx(s); |
| return (error); |
return (error); |
| Line 501 soclose(struct socket *so) |
|
| Line 501 soclose(struct socket *so) |
|
| if (so->so_pcb) { |
if (so->so_pcb) { |
| int error2 = (*so->so_proto->pr_usrreq)(so, PRU_DETACH, |
int error2 = (*so->so_proto->pr_usrreq)(so, PRU_DETACH, |
| (struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0, |
(struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0, |
| (struct proc *)0); |
(struct lwp *)0); |
| if (error == 0) |
if (error == 0) |
| error = error2; |
error = error2; |
| } |
} |
| Line 522 soabort(struct socket *so) |
|
| Line 522 soabort(struct socket *so) |
|
| { |
{ |
| |
|
| return (*so->so_proto->pr_usrreq)(so, PRU_ABORT, (struct mbuf *)0, |
return (*so->so_proto->pr_usrreq)(so, PRU_ABORT, (struct mbuf *)0, |
| (struct mbuf *)0, (struct mbuf *)0, (struct proc *)0); |
(struct mbuf *)0, (struct mbuf *)0, (struct lwp *)0); |
| } |
} |
| |
|
| int |
int |
| Line 538 soaccept(struct socket *so, struct mbuf |
|
| Line 538 soaccept(struct socket *so, struct mbuf |
|
| if ((so->so_state & SS_ISDISCONNECTED) == 0 || |
if ((so->so_state & SS_ISDISCONNECTED) == 0 || |
| (so->so_proto->pr_flags & PR_ABRTACPTDIS) == 0) |
(so->so_proto->pr_flags & PR_ABRTACPTDIS) == 0) |
| error = (*so->so_proto->pr_usrreq)(so, PRU_ACCEPT, |
error = (*so->so_proto->pr_usrreq)(so, PRU_ACCEPT, |
| (struct mbuf *)0, nam, (struct mbuf *)0, (struct proc *)0); |
(struct mbuf *)0, nam, (struct mbuf *)0, (struct lwp *)0); |
| else |
else |
| error = ECONNABORTED; |
error = ECONNABORTED; |
| |
|
| Line 549 soaccept(struct socket *so, struct mbuf |
|
| Line 549 soaccept(struct socket *so, struct mbuf |
|
| int |
int |
| soconnect(struct socket *so, struct mbuf *nam) |
soconnect(struct socket *so, struct mbuf *nam) |
| { |
{ |
| struct proc *p; |
|
| int s, error; |
int s, error; |
| |
|
| p = curproc; /* XXX */ |
|
| if (so->so_options & SO_ACCEPTCONN) |
if (so->so_options & SO_ACCEPTCONN) |
| return (EOPNOTSUPP); |
return (EOPNOTSUPP); |
| s = splsoftnet(); |
s = splsoftnet(); |
| Line 568 soconnect(struct socket *so, struct mbuf |
|
| Line 566 soconnect(struct socket *so, struct mbuf |
|
| error = EISCONN; |
error = EISCONN; |
| else |
else |
| error = (*so->so_proto->pr_usrreq)(so, PRU_CONNECT, |
error = (*so->so_proto->pr_usrreq)(so, PRU_CONNECT, |
| (struct mbuf *)0, nam, (struct mbuf *)0, p); |
(struct mbuf *)0, nam, (struct mbuf *)0, curlwp); /* XXX */ |
| splx(s); |
splx(s); |
| return (error); |
return (error); |
| } |
} |
| Line 581 soconnect2(struct socket *so1, struct so |
|
| Line 579 soconnect2(struct socket *so1, struct so |
|
| s = splsoftnet(); |
s = splsoftnet(); |
| error = (*so1->so_proto->pr_usrreq)(so1, PRU_CONNECT2, |
error = (*so1->so_proto->pr_usrreq)(so1, PRU_CONNECT2, |
| (struct mbuf *)0, (struct mbuf *)so2, (struct mbuf *)0, |
(struct mbuf *)0, (struct mbuf *)so2, (struct mbuf *)0, |
| (struct proc *)0); |
(struct lwp *)0); |
| splx(s); |
splx(s); |
| return (error); |
return (error); |
| } |
} |
| Line 602 sodisconnect(struct socket *so) |
|
| Line 600 sodisconnect(struct socket *so) |
|
| } |
} |
| error = (*so->so_proto->pr_usrreq)(so, PRU_DISCONNECT, |
error = (*so->so_proto->pr_usrreq)(so, PRU_DISCONNECT, |
| (struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0, |
(struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0, |
| (struct proc *)0); |
(struct lwp *)0); |
| bad: |
bad: |
| splx(s); |
splx(s); |
| sodopendfree(so); |
sodopendfree(so); |
| Line 638 sosend(struct socket *so, struct mbuf *a |
|
| Line 636 sosend(struct socket *so, struct mbuf *a |
|
| |
|
| sodopendfree(so); |
sodopendfree(so); |
| |
|
| p = curproc; /* XXX */ |
p = curproc; /* XXX */ |
| clen = 0; |
clen = 0; |
| atomic = sosendallatonce(so) || top; |
atomic = sosendallatonce(so) || top; |
| if (uio) |
if (uio) |
| Line 786 sosend(struct socket *so, struct mbuf *a |
|
| Line 784 sosend(struct socket *so, struct mbuf *a |
|
| so->so_state |= SS_MORETOCOME; |
so->so_state |= SS_MORETOCOME; |
| error = (*so->so_proto->pr_usrreq)(so, |
error = (*so->so_proto->pr_usrreq)(so, |
| (flags & MSG_OOB) ? PRU_SENDOOB : PRU_SEND, |
(flags & MSG_OOB) ? PRU_SENDOOB : PRU_SEND, |
| top, addr, control, p); |
top, addr, control, curlwp); /* XXX */ |
| if (dontroute) |
if (dontroute) |
| so->so_options &= ~SO_DONTROUTE; |
so->so_options &= ~SO_DONTROUTE; |
| if (resid > 0) |
if (resid > 0) |
| Line 858 soreceive(struct socket *so, struct mbuf |
|
| Line 856 soreceive(struct socket *so, struct mbuf |
|
| m = m_get(M_WAIT, MT_DATA); |
m = m_get(M_WAIT, MT_DATA); |
| error = (*pr->pr_usrreq)(so, PRU_RCVOOB, m, |
error = (*pr->pr_usrreq)(so, PRU_RCVOOB, m, |
| (struct mbuf *)(long)(flags & MSG_PEEK), (struct mbuf *)0, |
(struct mbuf *)(long)(flags & MSG_PEEK), (struct mbuf *)0, |
| (struct proc *)0); |
(struct lwp *)0); |
| if (error) |
if (error) |
| goto bad; |
goto bad; |
| do { |
do { |
| Line 875 soreceive(struct socket *so, struct mbuf |
|
| Line 873 soreceive(struct socket *so, struct mbuf |
|
| *mp = (struct mbuf *)0; |
*mp = (struct mbuf *)0; |
| if (so->so_state & SS_ISCONFIRMING && uio->uio_resid) |
if (so->so_state & SS_ISCONFIRMING && uio->uio_resid) |
| (*pr->pr_usrreq)(so, PRU_RCVD, (struct mbuf *)0, |
(*pr->pr_usrreq)(so, PRU_RCVD, (struct mbuf *)0, |
| (struct mbuf *)0, (struct mbuf *)0, (struct proc *)0); |
(struct mbuf *)0, (struct mbuf *)0, (struct lwp *)0); |
| |
|
| restart: |
restart: |
| if ((error = sblock(&so->so_rcv, SBLOCKWAIT(flags))) != 0) |
if ((error = sblock(&so->so_rcv, SBLOCKWAIT(flags))) != 0) |
| Line 949 soreceive(struct socket *so, struct mbuf |
|
| Line 947 soreceive(struct socket *so, struct mbuf |
|
| * info, we save a copy of m->m_nextpkt into nextrecord. |
* info, we save a copy of m->m_nextpkt into nextrecord. |
| */ |
*/ |
| #ifdef notyet /* XXXX */ |
#ifdef notyet /* XXXX */ |
| if (uio->uio_procp) |
if (uio->uio_lwp) |
| uio->uio_procp->p_stats->p_ru.ru_msgrcv++; |
uio->uio_lwp->l_proc->p_stats->p_ru.ru_msgrcv++; |
| #endif |
#endif |
| KASSERT(m == so->so_rcv.sb_mb); |
KASSERT(m == so->so_rcv.sb_mb); |
| SBLASTRECORDCHK(&so->so_rcv, "soreceive 1"); |
SBLASTRECORDCHK(&so->so_rcv, "soreceive 1"); |
| Line 1179 soreceive(struct socket *so, struct mbuf |
|
| Line 1177 soreceive(struct socket *so, struct mbuf |
|
| (struct mbuf *)0, |
(struct mbuf *)0, |
| (struct mbuf *)(long)flags, |
(struct mbuf *)(long)flags, |
| (struct mbuf *)0, |
(struct mbuf *)0, |
| (struct proc *)0); |
(struct lwp *)0); |
| SBLASTRECORDCHK(&so->so_rcv, "soreceive sbwait 2"); |
SBLASTRECORDCHK(&so->so_rcv, "soreceive sbwait 2"); |
| SBLASTMBUFCHK(&so->so_rcv, "soreceive sbwait 2"); |
SBLASTMBUFCHK(&so->so_rcv, "soreceive sbwait 2"); |
| error = sbwait(&so->so_rcv); |
error = sbwait(&so->so_rcv); |
| Line 1217 soreceive(struct socket *so, struct mbuf |
|
| Line 1215 soreceive(struct socket *so, struct mbuf |
|
| if (pr->pr_flags & PR_WANTRCVD && so->so_pcb) |
if (pr->pr_flags & PR_WANTRCVD && so->so_pcb) |
| (*pr->pr_usrreq)(so, PRU_RCVD, (struct mbuf *)0, |
(*pr->pr_usrreq)(so, PRU_RCVD, (struct mbuf *)0, |
| (struct mbuf *)(long)flags, (struct mbuf *)0, |
(struct mbuf *)(long)flags, (struct mbuf *)0, |
| (struct proc *)0); |
(struct lwp *)0); |
| } |
} |
| if (orig_resid == uio->uio_resid && orig_resid && |
if (orig_resid == uio->uio_resid && orig_resid && |
| (flags & MSG_EOR) == 0 && (so->so_state & SS_CANTRCVMORE) == 0) { |
(flags & MSG_EOR) == 0 && (so->so_state & SS_CANTRCVMORE) == 0) { |
| Line 1247 soshutdown(struct socket *so, int how) |
|
| Line 1245 soshutdown(struct socket *so, int how) |
|
| sorflush(so); |
sorflush(so); |
| if (how == SHUT_WR || how == SHUT_RDWR) |
if (how == SHUT_WR || how == SHUT_RDWR) |
| return (*pr->pr_usrreq)(so, PRU_SHUTDOWN, (struct mbuf *)0, |
return (*pr->pr_usrreq)(so, PRU_SHUTDOWN, (struct mbuf *)0, |
| (struct mbuf *)0, (struct mbuf *)0, (struct proc *)0); |
(struct mbuf *)0, (struct mbuf *)0, (struct lwp *)0); |
| return (0); |
return (0); |
| } |
} |
| |
|