7139 Sync mDNS with mDNSResponder-625.41.2
[unleashed.git] / usr / src / man / man3nsl / nlsrequest.3nsl
blob380aa1902ebb640149b8a60454feb1594bb691f9
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 2002, 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 NLSREQUEST 3NSL "Nov 14, 2002"
7 .SH NAME
8 nlsrequest \- format and send listener service request message
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <listen.h>
13 \fBint\fR \fBnlsrequest\fR(\fBint\fR \fIfildes\fR, \fBchar \fR*\fIservice_code\fR);
14 \fBextern int\fR \fI_nlslogt_errno\fR;
15 \fBextern char\fR *\fI_nlsrmsg\fR;
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 Given a virtual circuit to a listener process (\fIfildes\fR) and a  service
22 code of a server process, \fBnlsrequest()\fR formats and sends a \fIservice
23 request message\fR to the remote listener process  requesting that it start the
24 given service.   \fBnlsrequest()\fR waits for the remote listener process to
25 return a \fIservice request response message\fR,  which is made available to
26 the caller in the static, null-terminated data buffer pointed to by
27 \fB_nlsrmsg\fR. The \fIservice request response message\fR includes a success
28 or failure code and a text message. The entire message is printable.
29 .SH RETURN VALUES
30 .sp
31 .LP
32 The success or failure code is the integer return code from \fBnlsrequest()\fR.
33 Zero indicates success, other negative  values indicate \fBnlsrequest()\fR
34 failures as follows:
35 .sp
36 .ne 2
37 .na
38 \fB\fB\(mi1\fR\fR
39 .ad
40 .RS 9n
41 Error encountered by \fBnlsrequest()\fR, see \fBt_errno\fR.
42 .RE
44 .sp
45 .LP
46 Positive values are error return codes from the \fIlistener\fR process.
47 Mnemonics for these codes are defined in \fB<listen.h>\fR\&.
48 .sp
49 .ne 2
50 .na
51 \fB\fB2\fR\fR
52 .ad
53 .RS 5n
54 Request message not interpretable.
55 .RE
57 .sp
58 .ne 2
59 .na
60 \fB\fB3\fR\fR
61 .ad
62 .RS 5n
63 Request service code unknown.
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fB\fB4\fR\fR
70 .ad
71 .RS 5n
72 Service code known, but currently disabled.
73 .RE
75 .sp
76 .LP
77 If non-null, \fB_nlsrmsg\fR contains a pointer to a static, null-terminated
78 character buffer containing the \fIservice request response message\fR. Note
79 that both \fB_nlsrmsg\fR and the data buffer are overwritten by each call to
80 \fBnlsrequest()\fR.
81 .sp
82 .LP
83 If \fB_nlslog\fR is non-zero, \fBnlsrequest()\fR prints error messages on
84 stderr. Initially, \fB_nlslog\fR is zero.
85 .SH FILES
86 .sp
87 .ne 2
88 .na
89 \fB\fB/usr/lib/libnls.so.1\fR\fR
90 .ad
91 .RS 24n
92 shared object
93 .RE
95 .SH ATTRIBUTES
96 .sp
97 .LP
98 See \fBattributes\fR(5) for descriptions of the following attributes:
99 .sp
103 box;
104 c | c
105 l | l .
106 ATTRIBUTE TYPE  ATTRIBUTE VALUE
108 MT-Level        Unsafe
111 .SH SEE ALSO
114 \fBnlsadmin\fR(1M), \fBt_error\fR(3NSL), \fBt_snd\fR(3NSL), \fBt_rcv\fR(3NSL),
115 \fBattributes\fR(5)
116 .SH WARNINGS
119 \fBnlsrequest()\fR cannot always be certain that the remote server process has
120 been successfully started.  In this case, \fBnlsrequest()\fR returns with no
121 indication of an error and the caller will receive notification of a disconnect
122 event by way of a \fBT_LOOK\fR error before or during the first \fBt_snd()\fR
123 or \fBt_rcv()\fR call.
124 .SH NOTES
127 These interfaces are unsafe in multithreaded applications.  Unsafe interfaces
128 should be called only from the main thread.