Synchronizes transport library.
Transport Layer Interface Library (libtli.a)
#include <tiuser.h>
int t_sync(fd)
int fd;
The t_sync subroutine synchronizes the data structures managed by the transport library with information from the underlying transport provider. In doing so, this subroutine can convert a raw file descriptor (obtained using the open or dup subroutine, or as a result of a fork operation and an exec operation) to an initialized transport endpoint, assuming that the file descriptor referenced a transport provider. This subroutine also allows two cooperating processes to synchronize their interaction with a transport provider.
For example, a process creates a new process with the fork subroutine and issues an exec subroutine call. The new process must issue a t_sync subroutine call to build the private library data structure associated with a transport endpoint and to synchronize the data structure with the relevant provider information.
If the provider is undergoing a state transition when the t_sync subroutine is called, the subroutine will be unsuccessful.
Item | Description |
---|---|
fd | Specifies the transport end point. |
On successful completion, the t_sync subroutine returns the state of the transport provider. Otherwise, it returns a value of -1 and sets the t_errno variable to indicate the error. The state returned can be one of the following:
Value | Description |
---|---|
T_UNBIND | Unbound |
T_IDLE | Idle |
T_OUTCON | Outgoing connection pending |
T_INCON | Incoming connection pending |
T_DATAXFER | Data transfer |
T_OUTREL | Outgoing orderly release (waiting for an orderly release indication) |
T_INREL | Incoming orderly release (waiting for an orderly release request) |
If unsuccessful, the t_errno variable is set to one of the following:
Value | Description |
---|---|
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 has occurred during execution of this function. |