version 1.160.2.3, 2009/09/16 13:38:01 |
version 1.177.2.2, 2009/03/03 18:32:57 |
|
|
/* $NetBSD$ */ |
/* $NetBSD$ */ |
|
|
/*- |
/*- |
* Copyright (c) 2002, 2007, 2008, 2009 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 |
* by Jason R. Thorpe of Wasabi Systems, Inc, and by Andrew Doran. |
* by Jason R. Thorpe of Wasabi Systems, Inc. |
* |
* |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* modification, are permitted provided that the following conditions |
Line 555 fsocreate(int domain, struct socket **so |
|
Line 555 fsocreate(int domain, struct socket **so |
|
} |
} |
|
|
int |
int |
sofamily(const struct socket *so) |
|
{ |
|
const struct protosw *pr; |
|
const struct domain *dom; |
|
|
|
if ((pr = so->so_proto) == NULL) |
|
return AF_UNSPEC; |
|
if ((dom = pr->pr_domain) == NULL) |
|
return AF_UNSPEC; |
|
return dom->dom_family; |
|
} |
|
|
|
int |
|
sobind(struct socket *so, struct mbuf *nam, struct lwp *l) |
sobind(struct socket *so, struct mbuf *nam, struct lwp *l) |
{ |
{ |
int error; |
int error; |
Line 1560 soshutdown(struct socket *so, int how) |
|
Line 1547 soshutdown(struct socket *so, int how) |
|
return error; |
return error; |
} |
} |
|
|
int |
|
sodrain(struct socket *so) |
|
{ |
|
int error; |
|
|
|
solock(so); |
|
so->so_state |= SS_ISDRAINING; |
|
cv_broadcast(&so->so_cv); |
|
error = soshutdown(so, SHUT_RDWR); |
|
sounlock(so); |
|
|
|
return error; |
|
} |
|
|
|
void |
void |
sorflush(struct socket *so) |
sorflush(struct socket *so) |
{ |
{ |
Line 2105 sohasoutofband(struct socket *so) |
|
Line 2078 sohasoutofband(struct socket *so) |
|
{ |
{ |
|
|
fownsignal(so->so_pgid, SIGURG, POLL_PRI, POLLPRI|POLLRDBAND, so); |
fownsignal(so->so_pgid, SIGURG, POLL_PRI, POLLPRI|POLLRDBAND, so); |
selnotify(&so->so_rcv.sb_sel, POLLPRI | POLLRDBAND, NOTE_SUBMIT); |
selnotify(&so->so_rcv.sb_sel, POLLPRI | POLLRDBAND, 0); |
} |
} |
|
|
static void |
static void |
Line 2337 sysctl_kern_somaxkva(SYSCTLFN_ARGS) |
|
Line 2310 sysctl_kern_somaxkva(SYSCTLFN_ARGS) |
|
} |
} |
|
|
static void |
static void |
sysctl_kern_somaxkva_setup(void) |
sysctl_kern_somaxkva_setup() |
{ |
{ |
|
|
KASSERT(socket_sysctllog == NULL); |
KASSERT(socket_sysctllog == NULL); |