/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2014, Joyent, Inc. All rights reserved.
*/
#include <sys/vfs_opreg.h>
#include <sys/port_impl.h>
/* local functions */
caller_context_t *);
caller_context_t *);
caller_context_t *);
};
/* ARGSUSED */
static int
{
return (0);
}
/*
* port_discard_events() scans the port event queue for events owned
* by current proc. Non-shareable events will be discarded, all other
* events remain in the event queue.
*/
void
{
/*
* The call to port_block() is required to avoid interaction
* with other threads in port_get(n).
*/
while (kevp) {
/* own event, check if it is shareable */
}
}
}
/*
* Called from port_close().
* Free all kernel events structures which are still in the event queue.
*/
static void
{
portq->portq_nent--;
if (pkevp->portkev_callback) {
pkevp);
}
}
/*
* Wait for any thread in pollwakeup(), accessing this port to
* finish.
*/
}
}
/*
* The port_close() function is called from standard close(2) when
* Port file descriptors behave like standard file descriptors. It means,
* If the reference counter is > 1 then
* - sources associated with the port will be notified about the close,
* - objects associated with the port will be dissociated,
* - pending and delivered events will be discarded.
* On last close all references and caches will be removed. The vnode itself
* will be destroyed with VOP_RELE().
*/
/* ARGSUSED */
static int
{
int source;
return (0);
}
if (count > 1) {
/*
* It is not the last close.
* First notify all with the port associated sources about the
* close(2). The last argument of the close callback function
* advises the source about the type of of the close.
* If the port was set in alert mode by the curren process then
* remove the alert mode.
*/
/* check alert mode of the port */
/* notify all event sources about port_close() */
(*ps->portsrc_close)
}
}
return (0);
}
/*
* We are executing the last close of the port -> discard everything
* the kernel immediately.
*/
while (portq->portq_thrcnt > 0) {
}
/*
* Send "last close" message to associated sources.
* - new event allocation requests are being denied since uf_file entry
* was set to NULL in closeandsetf().
* - all still allocated event structures must be returned to the
* port immediately:
* - call port_free_event(*event) or
* - call port_send_event(*event) to complete event operations
* which need activities in a dedicated process environment.
* The port_close() function waits until all allocated event structures
* are delivered back to the port.
*/
}
}
PORT_SCACHE_SIZE * sizeof (port_source_t *));
/* Wait for outstanding events */
/*
* If PORT_SOURCE_FD objects were not associated with the port then
* it is necessary to free the port_fdcache structure here.
*/
}
/*
* Now all events are passed back to the port,
* discard remaining events in the port queue
*/
return (0);
}
/*
* The port_poll() function is the VOP_POLL() entry of event ports.
* Event ports return:
* POLLIN : events are available in the event queue
* POLLOUT : event queue can still accept events
*/
/*ARGSUSED*/
static int
{
short levents;
levents = 0;
if (portq->portq_nent)
}
return (0);
}
/* ARGSUSED */
static int
{
return (0);
}
/*
* Destroy the port.
*/
/* ARGSUSED */
static void
{
extern port_kstat_t port_kstat;
}
/* ARGSUSED */
static int
{
return (0);
}
/* ARGSUSED */
static int
{
return (0);
}