'\" 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]
.TH RSM_INTR_SIGNAL_POST 3RSM "Nov 7, 2002"
.SH NAME
rsm_intr_signal_post, rsm_intr_signal_wait \- signal or wait for an event
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR... ] \fIfile\fR... -lrsm [ \fIlibrary\fR... ]
#include <rsmapi.h>

\fBint\fR \fBrsm_intr_signal_post\fR(\fBvoid *\fR\fImemseg\fR, \fBuint_t\fR \fIflags\fR);
.fi

.LP
.nf
\fBint\fR \fBrsm_intr_signal_wait\fR(\fBvoid *\fR\fImemseg\fR, \fBint\fR \fItimeout\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The  \fBrsm_intr_signal_post()\fR and  \fBrsm_intr_signal_wait()\fR functions
are event functions that allow synchronization between importer processes and
exporter processes.  A process may block to wait for an event occurance by
calling \fBrsm_intr_signal_wait()\fR. A process can signal a waiting process
when an event occurs by calling \fBrsm_intr_signal_post()\fR.
.sp
.LP
The \fBrsm_intr_signal_post()\fR function signals an event occurance. Either an
import segment handle (\fBrsm_memseg_import_handle_t\fR) or an export segment
handle (\fBrsm_memseg_export_handle_t\fR) may be type cast to a void pointer
for the \fImemseg\fR argument. If \fImemseg\fR refers to an import handle, the
exporting process is signalled. If \fImemseg\fR refers to an export handle, all
importers of that segment are signalled. The \fIflags\fR argument may be set to
\fBRSM_SIGPOST_NO_ACCUMULATE\fR; this will cause this event to be discarded if
an event is already pending for the target segment.
.sp
.LP
The \fBrsm_intr_signal_wait()\fR function allows a process to block and wait
for an event occurance. Either an import segment handle
(\fBrsm_memseg_import_handle_t\fR) or an export segment handle
(\fBrsm_memseg_export_handle_t\fR) may be type cast to a void pointer for the
\fImemseg\fR argument. The process blocks for up to \fItimeout\fR milliseconds
for an event to occur; if the timeout value is -1, the process blocks until an
event occurs or until interrupted.
.SH RETURN VALUES
.sp
.LP
Upon successful completion, these functions return 0.  Otherwise, an error
value is returned to indicate the error.
.SH ERRORS
.sp
.LP
The \fBrsm_intr_signal_post()\fR and  \fBrsm_intr_signal_wait()\fR functions
can return the following error:
.sp
.ne 2
.na
\fB\fBRSMERR_BAD_SEG_HNDL\fR \fR
.ad
.RS 24n
Invalid segment handle.
.RE

.sp
.LP
The \fBrsm_intr_signal_post()\fR function can return the following error:
.sp
.ne 2
.na
\fB\fBRSMERR_CONN_ABORTED\fR \fR
.ad
.sp .6
.RS 4n
Connection aborted.
.RE

.sp
.ne 2
.na
\fB\fBRSMERR_REMOTE_NODE_UNREACHABL\fR \fR
.ad
.sp .6
.RS 4n
Remote node not reachable.
.RE

.sp
.LP
The \fBrsm_intr_signal_wait()\fR function can return the following errors:
.sp
.ne 2
.na
\fB\fBRSMERR_INTERRUPTED\fR \fR
.ad
.RS 23n
Wait interrupted.
.RE

.sp
.ne 2
.na
\fB\fBRSMERR_TIMEOUT\fR \fR
.ad
.RS 23n
Timer expired.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
l | l
l | l .
ATTRIBUTE TYPE 	ATTRIBUTE VALUE
_
Interface Stability	Evolving
_
MT-Level	MT-Safe
.TE

.SH SEE ALSO
.sp
.LP
\fBrsm_memseg_get_pollfd\fR(3RSM), \fBattributes\fR(5)