| version 1.177, 2008/10/14 13:45:26 |
version 1.177.4.3, 2009/05/03 13:18:55 |
|
|
| /* $NetBSD$ */ |
/* $NetBSD$ */ |
| |
|
| /*- |
/*- |
| * Copyright (c) 2002, 2007, 2008 The NetBSD Foundation, Inc. |
* Copyright (c) 2002, 2007, 2008, 2009 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. |
* by Jason R. Thorpe of Wasabi Systems, Inc, and by Andrew Doran. |
| * |
* |
| * 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 669 soclose(struct socket *so) |
|
| Line 669 soclose(struct socket *so) |
|
| if ((so->so_state & SS_ISDISCONNECTING) && so->so_nbio) |
if ((so->so_state & SS_ISDISCONNECTING) && so->so_nbio) |
| goto drop; |
goto drop; |
| while (so->so_state & SS_ISCONNECTED) { |
while (so->so_state & SS_ISCONNECTED) { |
| error = sowait(so, so->so_linger * hz); |
error = sowait(so, true, so->so_linger * hz); |
| if (error) |
if (error) |
| break; |
break; |
| } |
} |
| Line 1536 soshutdown(struct socket *so, int how) |
|
| Line 1536 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 2029 sohasoutofband(struct socket *so) |
|
| Line 2043 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, 0); |
selnotify(&so->so_rcv.sb_sel, POLLPRI | POLLRDBAND, NOTE_SUBMIT); |
| } |
} |
| |
|
| static void |
static void |