/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/*
* Copyright (c) 2014, Joyent, Inc. All rights reserved.
*/
#include <sys/socketvar.h>
/*
* There can only be a single thread waiting for data (enforced by
* so_lock_read()), whereas for write there might be multiple threads
* waiting for transmit buffers. So therefore we use cv_broadcast for
* write and cv_signal for read.
*/
if ((so)->so_rcv_wakeup) { \
} \
}
if ((so)->so_snd_wakeup) { \
} \
}
static int i_so_notify_last_rx(struct sonode *, int *, int *);
static int i_so_notify_last_tx(struct sonode *, int *, int *);
/*
* The notification functions must be called with so_lock held,
* and they will all *drop* so_lock before returning.
*/
/*
* Wake up anyone waiting for the connection to be established.
*/
void
{
if (IS_KERNEL_SOCKET(so)) {
} else {
}
}
/*
* The socket is disconnecting, so no more data can be sent. Wake up
* anyone that is waiting to send data.
*/
void
{
int pollev = 0;
int sigev = 0;
if (IS_KERNEL_SOCKET(so)) {
} else {
if (sigev != 0)
if (pollev != 0)
}
}
/*
* The socket is disconnected, so not more data can be sent or received.
* Wake up anyone that is waiting to send or receive data.
*/
void
{
int pollev = 0;
int sigev = 0;
if (IS_KERNEL_SOCKET(so)) {
if (connfailed) {
} else {
}
} else {
if (sigev != 0)
/*
* If we're here because the socket has become disconnected,
* we explicitly set POLLHUP. At the same time, we also clear
* POLLOUT, as POLLOUT and POLLHUP are defined to be mutually
* exclusive with respect to one another.
*/
if (!connfailed)
if (pollev != 0)
}
}
/*
* The socket is writeable. Wake up anyone waiting to send data.
*/
void
{
if (IS_KERNEL_SOCKET(so)) {
} else {
}
/* filters can start injecting data */
if (so->so_filter_active > 0)
}
/*
* Data is available, so wake up anyone waiting for data.
*/
void
{
if (IS_KERNEL_SOCKET(so)) {
} else {
} else {
}
}
}
/*
* Transient error. Wake up anyone waiting to send or receive data.
*/
void
{
if (IS_KERNEL_SOCKET(so)) {
} else {
}
}
/*
* Out-of-band data is incoming, notify any interested parties.
*/
void
{
}
/*
* Received out-of-band data. If the OOB data is delivered inline, then
* in addition of regular OOB notification, anyone waiting for normal
* data is also notified.
*/
void
{
if (IS_KERNEL_SOCKET(so)) {
} else {
if (oob_inline) {
} else {
}
}
}
/*
* End-of-file has been reach, so peer will send no new data. Wake up
* anyone that is waiting for data.
*/
void
{
int pollev = 0;
int sigev = 0;
if (IS_KERNEL_SOCKET(so)) {
} else {
if (sigev != 0)
if (pollev != 0)
}
}
/*
* Wake up anyone waiting for a new connection.
*/
void
{
if (IS_KERNEL_SOCKET(so)) {
} else {
} else {
}
}
}
/*
* an operation that is no longer possible.
*/
void
{
int pollev = 0;
int sigev = 0;
if (sigev != 0)
if (pollev != 0)
}
/*
* No more data will be coming in, and this will be the last notification
* made.
*/
static int
{
*sigev |= SOCKETSIG_READ;
return (1);
} else {
return (0);
}
}
/*
* The socket is un-writeable. Make one last notification.
*/
static int
{
*sigev |= SOCKETSIG_WRITE;
return (1);
} else {
return (0);
}
}