Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/uipc_socket.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/uipc_socket.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.146 retrieving revision 1.152 diff -u -p -r1.146 -r1.152 --- src/sys/kern/uipc_socket.c 2007/11/24 07:46:11 1.146 +++ src/sys/kern/uipc_socket.c 2008/02/27 19:55:59 1.152 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.146 2007/11/24 07:46:11 dyoung Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.152 2008/02/27 19:55:59 matt Exp $ */ /*- * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.146 2007/11/24 07:46:11 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.152 2008/02/27 19:55:59 matt Exp $"); #include "opt_sock_counters.h" #include "opt_sosend_loan.h" @@ -280,7 +280,7 @@ sodoloanfree(struct vm_page **pgs, void } static size_t -sodopendfree() +sodopendfree(void) { size_t rv; @@ -299,7 +299,7 @@ sodopendfree() */ static size_t -sodopendfreel() +sodopendfreel(void) { struct mbuf *m, *next; size_t rv = 0; @@ -428,11 +428,11 @@ sokva_reclaim_callback(struct callback_e } struct mbuf * -getsombuf(struct socket *so) +getsombuf(struct socket *so, int type) { struct mbuf *m; - m = m_get(M_WAIT, MT_SONAME); + m = m_get(M_WAIT, type); MCLAIM(m, so->so_mowner); return m; } @@ -442,7 +442,7 @@ m_intopt(struct socket *so, int val) { struct mbuf *m; - m = getsombuf(so); + m = getsombuf(so, MT_SOOPTS); m->m_len = sizeof(int); *mtod(m, int *) = val; return m; @@ -452,7 +452,7 @@ void soinit(void) { - mutex_init(&so_pendfree_lock, MUTEX_DRIVER, IPL_VM); + mutex_init(&so_pendfree_lock, MUTEX_DEFAULT, IPL_VM); cv_init(&socurkva_cv, "sokva"); /* Set the initial adjusted socket buffer size. */ @@ -580,13 +580,13 @@ sobind(struct socket *so, struct mbuf *n } int -solisten(struct socket *so, int backlog) +solisten(struct socket *so, int backlog, struct lwp *l) { int s, error; s = splsoftnet(); error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, NULL, - NULL, NULL, NULL); + NULL, NULL, l); if (error != 0) { splx(s); return error; @@ -660,8 +660,7 @@ soclose(struct socket *so) goto drop; } if (so->so_options & SO_LINGER) { - if ((so->so_state & SS_ISDISCONNECTING) && - (so->so_state & SS_NBIO)) + if ((so->so_state & SS_ISDISCONNECTING) && so->so_nbio) goto drop; while (so->so_state & SS_ISCONNECTED) { error = tsleep((void *)&so->so_timeo, @@ -870,7 +869,7 @@ sosend(struct socket *so, struct mbuf *a snderr(EMSGSIZE); if (space < resid + clen && (atomic || space < so->so_snd.sb_lowat || space < clen)) { - if (so->so_state & SS_NBIO) + if (so->so_nbio) snderr(EWOULDBLOCK); sbunlock(&so->so_snd); error = sbwait(&so->so_snd); @@ -1110,7 +1109,7 @@ soreceive(struct socket *so, struct mbuf } if (uio->uio_resid == 0) goto release; - if ((so->so_state & SS_NBIO) || (flags & MSG_DONTWAIT)) { + if (so->so_nbio || (flags & MSG_DONTWAIT)) { error = EWOULDBLOCK; goto release; } @@ -1795,7 +1794,7 @@ soo_kqfilter(struct file *fp, struct kno sb = &so->so_snd; break; default: - return (1); + return (EINVAL); } SLIST_INSERT_HEAD(&sb->sb_sel.sel_klist, kn, kn_selnext); sb->sb_flags |= SB_KNOTE;