| version 1.151, 2008/02/06 21:57:54 |
version 1.151.2.1, 2008/03/24 07:16:14 |
|
|
| /* $NetBSD$ */ |
/* $NetBSD$ */ |
| |
|
| /*- |
/*- |
| * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc. |
* Copyright (c) 2002, 2007, 2008 The NetBSD Foundation, Inc. |
| * All rights reserved. |
* All rights reserved. |
| * |
* |
| * This code is derived from software contributed to The NetBSD Foundation |
* This code is derived from software contributed to The NetBSD Foundation |
| Line 280 sodoloanfree(struct vm_page **pgs, void |
|
| Line 280 sodoloanfree(struct vm_page **pgs, void |
|
| } |
} |
| |
|
| static size_t |
static size_t |
| sodopendfree() |
sodopendfree(void) |
| { |
{ |
| size_t rv; |
size_t rv; |
| |
|
|
|
| */ |
*/ |
| |
|
| static size_t |
static size_t |
| sodopendfreel() |
sodopendfreel(void) |
| { |
{ |
| struct mbuf *m, *next; |
struct mbuf *m, *next; |
| size_t rv = 0; |
size_t rv = 0; |
| Line 1682 sogetopt(struct socket *so, int level, i |
|
| Line 1682 sogetopt(struct socket *so, int level, i |
|
| void |
void |
| sohasoutofband(struct socket *so) |
sohasoutofband(struct socket *so) |
| { |
{ |
| |
|
| fownsignal(so->so_pgid, SIGURG, POLL_PRI, POLLPRI|POLLRDBAND, so); |
fownsignal(so->so_pgid, SIGURG, POLL_PRI, POLLPRI|POLLRDBAND, so); |
| selwakeup(&so->so_rcv.sb_sel); |
selnotify(&so->so_rcv.sb_sel, POLLPRI | POLLRDBAND, 0); |
| } |
} |
| |
|
| static void |
static void |
| Line 1801 soo_kqfilter(struct file *fp, struct kno |
|
| Line 1802 soo_kqfilter(struct file *fp, struct kno |
|
| return (0); |
return (0); |
| } |
} |
| |
|
| |
static int |
| |
sodopoll(struct socket *so, int events) |
| |
{ |
| |
int revents; |
| |
|
| |
revents = 0; |
| |
|
| |
if (events & (POLLIN | POLLRDNORM)) |
| |
if (soreadable(so)) |
| |
revents |= events & (POLLIN | POLLRDNORM); |
| |
|
| |
if (events & (POLLOUT | POLLWRNORM)) |
| |
if (sowritable(so)) |
| |
revents |= events & (POLLOUT | POLLWRNORM); |
| |
|
| |
if (events & (POLLPRI | POLLRDBAND)) |
| |
if (so->so_oobmark || (so->so_state & SS_RCVATMARK)) |
| |
revents |= events & (POLLPRI | POLLRDBAND); |
| |
|
| |
return revents; |
| |
} |
| |
|
| |
int |
| |
sopoll(struct socket *so, int events) |
| |
{ |
| |
int revents = 0; |
| |
int s; |
| |
|
| |
if ((revents = sodopoll(so, events)) != 0) |
| |
return revents; |
| |
|
| |
KERNEL_LOCK(1, curlwp); |
| |
s = splsoftnet(); |
| |
|
| |
if ((revents = sodopoll(so, events)) == 0) { |
| |
if (events & (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND)) { |
| |
selrecord(curlwp, &so->so_rcv.sb_sel); |
| |
so->so_rcv.sb_flags |= SB_SEL; |
| |
} |
| |
|
| |
if (events & (POLLOUT | POLLWRNORM)) { |
| |
selrecord(curlwp, &so->so_snd.sb_sel); |
| |
so->so_snd.sb_flags |= SB_SEL; |
| |
} |
| |
} |
| |
|
| |
splx(s); |
| |
KERNEL_UNLOCK_ONE(curlwp); |
| |
|
| |
return revents; |
| |
} |
| |
|
| |
|
| #include <sys/sysctl.h> |
#include <sys/sysctl.h> |
| |
|
| static int sysctl_kern_somaxkva(SYSCTLFN_PROTO); |
static int sysctl_kern_somaxkva(SYSCTLFN_PROTO); |