t_sync(S) (TLI/XTI) 6 January 1993 t_sync(S) Name t_sync - synchronize transport library Syntax TLI syntax cc . . . -lnsls #include <sys/tiuser.h> int t_sync (fd) int fd; XTI syntax cc . . . -lxti #include <xti.h> int t_sync (fd) int fd; Description For the transport endpoint specified by fd, tsync synchronizes the data structures managed by the transport library with information from the underlying transport provider. In doing so, it can convert a raw file descriptor (obtained via open(S), dup(S), or as a result of a fork(S) and exec(S)) to an initialized transport endpoint, assuming that file descriptor referenced a transport provider. This function also allows two cooperating processes to synchronize their interaction with a trans- port provider. For example, if a process forks a new process and issues an exec, the new process must issue a tsync to build the private library data structure associated with a transport endpoint and to synchronize the data struc- ture with the relevant provider information. It is important to remember that the transport provider treats all users of a transport endpoint as a single user. If multiple processes are using the same endpoint, they should coordinate their activities so as not to violate the state of the provider. tsync returns the current state of the provider to the user, thereby enabling the user to verify the state before taking further action. This coordination is only valid among cooperating processes; it is possible that a process or an incoming event could change the provider's state after a tsync is issued. If the provider is undergoing a state transition when tsync is called, the function fails. On failure, terrno may be set to one of the following: [TBADF] The specified file descriptor is a valid open file descriptor but does not refer to a transport endpoint. [TSTATECHNG] The transport provider is undergoing a state change. [TSYSERR] A system error occurred during execution of this func- tion. One possibility is an I/O error and is indi- cated by EIO being set in errno. Diagnostics The tsync function returns the state of the transport provider on suc- cessful completion and -1 on failure, and terrno is set to indicate the error. The state returned may be one of the following: TDATAXFER data transfer TIDLE idle TINCON incoming connection pending TINREL incoming orderly release (waiting for an orderly release request). TOUTCON outgoing connection pending TOUTREL outgoing orderly release (waiting for an orderly release indication) TUNBND unbound See also dup(S), exec(S), fork(S), open(S) Standards conformance tsync is conformant with: AT&T SVID Issue 2; X/Open Portability Guide, Issue 3, 1989; and Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2).