Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man3rsm / rsm_memseg_get_pollfd.3rsm
blob623758468d87ca1eb2369b3308ec19001eee934c
1 '\" te
2 .\"  Copyright (c) 2002 by Sun Microsystems, Inc.  All rights reserved.
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH RSM_MEMSEG_GET_POLLFD 3RSM "Dec 1, 2002"
7 .SH NAME
8 rsm_memseg_get_pollfd, rsm_memseg_release_pollfd \- get or release a poll
9 descriptor
10 .SH SYNOPSIS
11 .LP
12 .nf
13 cc [ \fIflag\fR... ] \fIfile\fR... -lrsm [ \fIlibrary\fR... ]
14 #include <rsmapi.h>
16 \fBint\fR \fBrsm_memseg_get_pollfd\fR(\fBvoid *\fR\fImemseg\fR, \fBstruct pollfd *\fR\fIfd\fR);
17 .fi
19 .LP
20 .nf
21 \fBint\fR \fBrsm_memseg_release_pollfd\fR(\fBvoid *\fR\fImemseg\fR);
22 .fi
24 .SH DESCRIPTION
25 .sp
26 .LP
27 The \fBrsm_memseg_get_pollfd()\fR and \fBrsm_memseg_release_pollfd()\fR
28 functions provide an alternative to \fBrsm_intr_signal_wait\fR(3RSM). The
29 waiting process can multiplex event waiting using the \fBpoll\fR(2) function
30 after first obtaining a poll descriptor using \fBrsm_memseg_get_pollfd()\fR.
31 The descriptor can subsequently be released using
32 \fBrsm_memseg_release_pollfd()\fR.
33 .sp
34 .LP
35 As a result of a call \fBrsm_memseg_get_pollfd()\fR, the specified \fBpollfd\fR
36 structure is initialized with a descriptor for the specified segment
37 (\fImemseg\fR) and the event generated by \fBrsm_intr_signal_post\fR(3RSM).
38 Either an export segment handle or an import segment handle can be type cast to
39 a void pointer. The \fIpollfd\fR argument can subsequently be used with the
40 \fBrsm_intr_signal_wait_pollfd\fR(3RSM) function to wait for the event; it
41 cannot be used with \fBpoll()\fR. If \fImemseg\fR references an export segment,
42 the segment must be currently published.  If \fImemseg\fR references an import
43 segment, the segment must be connected.
44 .sp
45 .LP
46 The \fBrsm_memseg_reslease_pollfd()\fR function decrements the reference count
47 of the \fBpollfd\fR structure associated with the specified segment.  A segment
48 unpublish, destroy or unmap operation will fail if the reference count is
49 non-zero.
50 .SH RETURN VALUES
51 .sp
52 .LP
53 Upon successful completion, these functions return 0.  Otherwise, an error
54 value is returned to indicate the error.
55 .SH ERRORS
56 .sp
57 .LP
58 The \fBrsm_memseg_get_pollfd()\fR and \fBrsm_memseg_release_pollfd()\fR
59 function can return the following error:
60 .sp
61 .ne 2
62 .na
63 \fB\fBRSMERR_BAD_SEG_HNDL\fR \fR
64 .ad
65 .RS 24n
66 Invalid segment handle.
67 .RE
69 .SH ATTRIBUTES
70 .sp
71 .LP
72 See \fBattributes\fR(5) for descriptions of the following attributes:
73 .sp
75 .sp
76 .TS
77 box;
78 l | l
79 l | l .
80 ATTRIBUTE TYPE  ATTRIBUTE VALUE
82 Interface Stability     Evolving
84 MT-Level        MT-Safe
85 .TE
87 .SH SEE ALSO
88 .sp
89 .LP
90 \fBpoll\fR(2), \fBrsm_intr_signal_post\fR(3RSM),
91 \fBrsm_intr_signal_wait_pollfd\fR(3RSM), \fBattributes\fR(5)