t_sync - Synchronizes transport library
XTI Library (libxti.a)
int fd) ;
Interfaces documented on this reference page conform to industry standards as follows:
Refer to the standards(5) reference page for more information about industry standards and associated tags.
The following table summarizes the relevance of input parameter data before and after t_sync() is called:
|Parameter||Before Call||After Call|
y This is a meaningful parameter. n This is not a meaningful parameter.
The t_sync() function can be called in any transport provider state except T_UNINIT.
The t_sync() XTI utility service function is used to synchronize data structures managed by the transport library with information from the underlying transport provider.
The t_sync() function can be used to convert an uninitialized file descriptor, previously returned by the open() or dup() functions, or returned as the result of fork() or exec() functions, to an initialized transport endpoint. When the file descriptor references a valid transport endpoint, necessary library data structures are allocated and updated.
The t_sync() function also permits two cooperating processes to synchronize their interaction with a transport provider. When a process forks, for example, and an exec() function is issued, the child (new) process must call the t_sync() function to build a private library data structure associated with the transport endpoint referenced by the fd parameter and to synchronize the library data structure with relevant transport provider information.
A transport provider treats multiple users of a transport endpoint as the same user. When more than one process is using the same transport endpoint, each should coordinate its activities so that operation does not conflict with the transport provider state at the transport endpoint specified by fd.
The t_sync() function returns the current state of the transport provider (refer to the t_getstate() function). Return of the current state of the transport provider permits the calling transport user to verify the transport provider state before issuing the next function call. This coordination is only valid among cooperating processes; it is possible that a process or an incoming event can change the transport provider state at the reference transport endpoint after t_sync() is called.
When the transport provider at the transport endpoint referenced by the fd parameter is undergoing a change of state and the t_sync() function is called, the t_sync() process fails and returns a [TSTATECHNG] error.
Upon successful completion, the state of the transport provider at the transport endpoint specified by the fd parameter is returned. Otherwise, a value of -1 is returned and t_errno is set to indicate the error. The returned state is one of the following:
If the t_sync() function fails, t_errno may be set to one of the following values:
Functions: exec(2), fcntl(2), fork(2), open(2), t_getstate(3) delim off