2 .\" Copyright (C) 2003, 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 RPC_SVC_INPUT 3NSL "Jan 6, 2003"
8 rpc_svc_input, svc_add_input, svc_remove_input \- declare or remove a callback
15 \fBtypedef void (*\fR\fBsvc_callback_t\fR)(\fBsvc_input_id_t\fR \fIid\fR, \fBint\fR \fIfd\fR,
16 \fBunsigned int\fR \fIevents\fR, \fBvoid *\fR\fIcookie\fR);
21 \fBsvc_input_id_t\fR \fBsvc_add_input\fR(\fBint\fR \fIfd\fR, \fBunsigned int\fR \fIrevents\fR,
22 \fBsvc_callback_t\fR \fIcallback\fR, \fBvoid *\fR\fIcookie\fR);
27 \fBint\fR \fBsvc_remove_input\fR(\fBsvc_input_t\fR \fIid\fR);
33 The following RPC routines are used to declare or remove a callback on a file
38 See \fBrpc\fR(3NSL) for the definition of the \fBSVCXPRT\fR data structure.
42 \fBsvc_add_input\fB()\fR\fR
45 This function is used to register a \fIcallback\fR function on a file
46 descriptor, \fIfd\fR. The file descriptor, \fIfd\fR, is the first parameter to
47 be passed to \fBsvc_add_input()\fR. This \fIcallback\fR function will be
48 automatically called if any of the events specified in the \fIevents\fR
49 parameter occur on this descriptor. The \fIevents\fR parameter is used to
50 specify when the callback is invoked. This parameter is a mask of poll events
51 to which the user wants to listen. See \fBpoll\fR(2) for further details of the
52 events that can be specified.
54 The callback to be invoked is specified using the \fIcallback\fR parameter. The
55 \fIcookie\fR parameter can be used to pass any data to the \fIcallback\fR
56 function. This parameter is a user-defined value which is passed as an argument
57 to the \fIcallback\fR function, and it is not used by the Sun RPC library
60 Several callbacks can be registered on the same file descriptor as long as each
61 callback registration specifies a separate set of event flags.
63 The \fIcallback\fR function is called with the registration \fIid\fR, the
64 \fIfd\fR file descriptor, an \fIrevents\fR value, which is a bitmask of all
65 events concerning the file descriptor, and the \fIcookie\fR user-defined value.
67 Upon successful completion, the function returns a unique identifier for this
68 registration, that can be used later to remove this callback. Upon failure,
69 \fB-1\fR is returned and \fBerrno\fR is set to indicate the error.
71 The \fBsvc_add_input()\fR function will fail if:
78 The \fIfd\fR or \fIevents\fR parameters are invalid.
87 A callback is already registered to the file descriptor with one of the
105 \fB\fBsvc_remove_input()\fR\fR
108 This function is used to unregister a callback function on a file descriptor,
109 \fIfd\fR. The \fIid\fR parameter specifies the registration to be removed.
111 Upon successful completion, the function returns zero. Upon failure, \fB-1\fR
112 is returned and \fBerrno\fR is set to indicate the error.
114 The \fBsvc_remove_input()\fR function will fail if:
121 The \fIid\fR parameter is invalid.
129 See \fBattributes\fR(5) for descriptions of the following attributes:
137 ATTRIBUTE TYPE ATTRIBUTE VALUE
141 Interface Stability Evolving
149 \fBpoll\fR(2), \fBrpc\fR(3NSL), \fBattributes\fR(5)