xref: /titanic_44/usr/src/man/man3rsm/rsm_memseg_get_pollfd.3rsm (revision 5ee6ac27d4fd4c9412183aa8cc1143f36ae04a8c)
te
Copyright (c) 2002 by Sun Microsystems, Inc. All rights reserved.
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 or http://www.opensolaris.org/os/licensing. 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]
RSM_MEMSEG_GET_POLLFD 3RSM "Dec 1, 2002"
NAME
rsm_memseg_get_pollfd, rsm_memseg_release_pollfd - get or release a poll descriptor
SYNOPSIS

cc [ flag... ] file... -lrsm [ library... ]
#include <rsmapi.h>

int rsm_memseg_get_pollfd(void *memseg, struct pollfd *fd);

int rsm_memseg_release_pollfd(void *memseg);
DESCRIPTION

The rsm_memseg_get_pollfd() and rsm_memseg_release_pollfd() functions provide an alternative to rsm_intr_signal_wait(3RSM). The waiting process can multiplex event waiting using the poll(2) function after first obtaining a poll descriptor using rsm_memseg_get_pollfd(). The descriptor can subsequently be released using rsm_memseg_release_pollfd().

As a result of a call rsm_memseg_get_pollfd(), the specified pollfd structure is initialized with a descriptor for the specified segment (memseg) and the event generated by rsm_intr_signal_post(3RSM). Either an export segment handle or an import segment handle can be type cast to a void pointer. The pollfd argument can subsequently be used with the rsm_intr_signal_wait_pollfd(3RSM) function to wait for the event; it cannot be used with poll(). If memseg references an export segment, the segment must be currently published. If memseg references an import segment, the segment must be connected.

The rsm_memseg_reslease_pollfd() function decrements the reference count of the pollfd structure associated with the specified segment. A segment unpublish, destroy or unmap operation will fail if the reference count is non-zero.

RETURN VALUES

Upon successful completion, these functions return 0. Otherwise, an error value is returned to indicate the error.

ERRORS

The rsm_memseg_get_pollfd() and rsm_memseg_release_pollfd() function can return the following error: RSMERR_BAD_SEG_HNDL

Invalid segment handle.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Evolving
MT-Level MT-Safe
SEE ALSO

poll(2), rsm_intr_signal_post(3RSM), rsm_intr_signal_wait_pollfd(3RSM), attributes(5)