1t_sync(3NSL) Networking Services Library Functions t_sync(3NSL)
2
3
4
6 t_sync - synchronize transport library
7
9 #include <xti.h>
10
11
12
13 int t_sync(int fd);
14
15
17 This routine is part of the XTI interfaces which evolved from the TLI
18 interfaces. XTI represents the future evolution of these interfaces.
19 However, TLI interfaces are supported for compatibility. When using a
20 TLI routine that has the same name as an XTI routine, the tiuser.h
21 header file must be used. Refer to the TLI COMPATIBILITY section for
22 a description of differences between the two interfaces.
23
24
25 For the transport endpoint specified by fd, t_sync() synchronizes the
26 data structures managed by the transport library with information from
27 the underlying transport provider. In doing so, it can convert an
28 uninitialized file descriptor (obtained by means of a open(2), dup(2)
29 or as a result of a fork(2) and exec(2)) to an initialized transport
30 endpoint, assuming that the file descriptor referenced a transport
31 endpoint, by updating and allocating the necessary library data struc‐
32 tures. This function also allows two cooperating processes to synchro‐
33 nize their interaction with a transport provider.
34
35
36 For example, if a process forks a new process and issues an exec(2),
37 the new process must issue a t_sync() to build the private library data
38 structure associated with a transport endpoint and to synchronize the
39 data structure with the relevant provider information.
40
41
42 It is important to remember that the transport provider treats all
43 users of a transport endpoint as a single user. If multiple processes
44 are using the same endpoint, they should coordinate their activities so
45 as not to violate the state of the transport endpoint. The function
46 t_sync() returns the current state of the transport endpoint to the
47 user, thereby enabling the user to verify the state before taking fur‐
48 ther action. This coordination is only valid among cooperating pro‐
49 cesses; it is possible that a process or an incoming event could change
50 the endpoint's state after a t_sync() is issued.
51
52
53 If the transport endpoint is undergoing a state transition when
54 t_sync() is called, the function will fail.
55
57 On successful completion, the state of the transport endpoint is
58 returned. Otherwise, a value of -1 is returned and t_errno is set to
59 indicate an error. The state returned is one of the following:
60
61 T_UNBND Unbound.
62
63
64 T_IDLE Idle.
65
66
67 T_OUTCON Outgoing connection pending.
68
69
70 T_INCON Incoming connection pending.
71
72
73 T_DATAXFER Data transfer.
74
75
76 T_OUTREL Outgoing orderly release (waiting for an orderly release
77 indication).
78
79
80 T_INREL Incoming orderly release (waiting for an orderly release
81 request).
82
83
85 On failure, t_errno is set to one of the following:
86
87 TBADF The specified file descriptor does not refer to a trans‐
88 port endpoint. This error may be returned when the fd has
89 been previously closed or an erroneous number may have
90 been passed to the call.
91
92
93 TPROTO This error indicates that a communication problem has
94 been detected between XTI and the transport provider for
95 which there is no other suitable XTI error (t_errno).
96
97
98 TSTATECHNG The transport endpoint is undergoing a state change.
99
100
101 TSYSERR A system error has occurred during execution of this
102 function.
103
104
106 The XTI and TLI interface definitions have common names but use differ‐
107 ent header files. This, and other semantic differences between the two
108 interfaces are described in the subsections below.
109
110 Interface Header
111 The XTI interfaces use the header file, xti.h. TLI interfaces should
112 not use this header. They should use the header:
113 #include <tiuser.h>
114
115 Error Description Values
116 The t_errno value that can be set by the XTI interface and cannot be
117 set by the TLI interface is:
118 TPROTO
119
121 See attributes(5) for descriptions of the following attributes:
122
123
124
125
126 ┌─────────────────────────────┬─────────────────────────────┐
127 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
128 ├─────────────────────────────┼─────────────────────────────┤
129 │MT Level │Safe │
130 └─────────────────────────────┴─────────────────────────────┘
131
133 dup(2), exec(2), fork(2), open(2), attributes(5)
134
135
136
137SunOS 5.11 7 May 1998 t_sync(3NSL)