7139 Sync mDNS with mDNSResponder-625.41.2
[unleashed.git] / usr / src / man / man3nsl / t_sync.3nsl
blob36e352a21049671d61bc7a3fee91e11a224bbcb7
1 '\" te
2 .\"  Copyright 1994, The X/Open Company Ltd.  All Rights Reserved  Portions Copyright 1989 AT&T  Portions Copyright (c) 1998, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\"  This notice shall appear on any product containing this material.
7 .\" 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.
8 .\" 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.
9 .\" 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]
10 .TH T_SYNC 3NSL "May 7, 1998"
11 .SH NAME
12 t_sync \- synchronize transport library
13 .SH SYNOPSIS
14 .LP
15 .nf
16 #include <xti.h>
20 \fBint\fR \fBt_sync\fR(\fBint\fR \fIfd\fR);
21 .fi
23 .SH DESCRIPTION
24 .sp
25 .LP
26 This routine is part of the \fBXTI\fR interfaces which evolved from the
27 \fBTLI\fR interfaces. \fBXTI\fR represents the future evolution of these
28 interfaces. However, \fBTLI\fR interfaces are supported for compatibility. When
29 using a \fBTLI\fR routine that has the same name as an \fBXTI\fR routine, the
30 \fBtiuser.h\fR header file must be used.  Refer to the  \fBTLI\fR
31 \fBCOMPATIBILITY\fR section for a description of differences between the two
32 interfaces.
33 .sp
34 .LP
35 For the transport endpoint specified by \fIfd\fR, \fBt_sync()\fR synchronizes
36 the data structures managed by the transport library with information from the
37 underlying transport provider. In doing so, it can convert an uninitialized
38 file descriptor (obtained by means of a  \fBopen\fR(2), \fBdup\fR(2) or as a
39 result of a \fBfork\fR(2) and \fBexec\fR(2)) to an initialized transport
40 endpoint, assuming that the file descriptor referenced a transport  endpoint,
41 by updating and allocating the necessary library data structures. This function
42 also allows two cooperating processes to synchronize their interaction with a
43 transport provider.
44 .sp
45 .LP
46 For example, if a process forks a new process and issues an \fBexec\fR(2), the
47 new process must issue a \fBt_sync()\fR to build the private library data
48 structure associated with a transport endpoint and to synchronize the data
49 structure with the relevant provider information.
50 .sp
51 .LP
52 It is important to remember that the transport provider treats all users of a
53 transport endpoint as a single user. If multiple processes are using the same
54 endpoint, they should coordinate their activities so as not to violate the
55 state of the transport endpoint.  The function \fBt_sync()\fR returns the
56 current state of the transport endpoint to the user, thereby enabling the user
57 to verify the state before taking further action. This coordination is only
58 valid among cooperating processes; it is possible that a process or an incoming
59 event could change the endpoint's state \fIafter\fR a \fBt_sync()\fR is issued.
60 .sp
61 .LP
62 If the transport endpoint is undergoing a state transition when \fBt_sync()\fR
63 is called, the function will fail.
64 .SH RETURN VALUES
65 .sp
66 .LP
67 On successful completion, the state of the transport endpoint is returned.
68 Otherwise, a value of  -1 is returned and \fBt_errno\fR is set to indicate an
69 error. The state returned is one of the following:
70 .sp
71 .ne 2
72 .na
73 \fB\fBT_UNBND\fR \fR
74 .ad
75 .RS 15n
76 Unbound.
77 .RE
79 .sp
80 .ne 2
81 .na
82 \fB\fBT_IDLE\fR \fR
83 .ad
84 .RS 15n
85 Idle.
86 .RE
88 .sp
89 .ne 2
90 .na
91 \fB\fBT_OUTCON\fR \fR
92 .ad
93 .RS 15n
94 Outgoing connection pending.
95 .RE
97 .sp
98 .ne 2
99 .na
100 \fB\fBT_INCON\fR \fR
102 .RS 15n
103 Incoming connection pending.
107 .ne 2
109 \fB\fBT_DATAXFER\fR \fR
111 .RS 15n
112 Data transfer.
116 .ne 2
118 \fB\fBT_OUTREL\fR \fR
120 .RS 15n
121 Outgoing orderly release (waiting for an orderly release indication).
125 .ne 2
127 \fB\fBT_INREL\fR \fR
129 .RS 15n
130 Incoming orderly release (waiting for an orderly release request).
133 .SH ERRORS
136 On failure, \fBt_errno\fR is set to one of the following:
138 .ne 2
140 \fB\fBTBADF\fR\fR
142 .RS 14n
143 The specified file descriptor does not refer to a transport endpoint. This
144 error may be returned when the \fIfd\fR has been previously closed or an
145 erroneous number may have been passed to the call.
149 .ne 2
151 \fB\fBTPROTO\fR\fR
153 .RS 14n
154 This error indicates that a communication problem has been detected between XTI
155 and the transport provider for which there is no other suitable XTI error
156 \fB(t_errno)\fR.
160 .ne 2
162 \fB\fBTSTATECHNG\fR\fR
164 .RS 14n
165 The transport endpoint is undergoing a state change.
169 .ne 2
171 \fB\fBTSYSERR\fR\fR
173 .RS 14n
174 A system error has occurred during execution of this function.
177 .SH TLI COMPATIBILITY
180 The \fBXTI\fR and \fBTLI\fR interface definitions have common names but use
181 different header files. This, and other semantic differences between the two
182 interfaces are described in the subsections below.
183 .SS "Interface Header"
186 The \fBXTI\fR interfaces use the header file, \fBxti.h\fR. \fBTLI\fR interfaces
187 should \fInot\fR use this header.  They should use the header:
189 .in +2
190 #include <tiuser.h>
191 .in -2
192 .SS "Error Description Values"
195 The \fBt_errno\fR value that can be set by the \fBXTI\fR interface and cannot
196 be set by the \fBTLI\fR interface is:
198 .in +2
199 \fBTPROTO\fR
200 .in -2
201 .SH ATTRIBUTES
204 See \fBattributes\fR(5)  for descriptions of the following attributes:
209 box;
210 c | c
211 l | l .
212 ATTRIBUTE TYPE  ATTRIBUTE VALUE
214 MT Level        Safe
217 .SH SEE ALSO
220 \fBdup\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBopen\fR(2), \fBattributes\fR(5)