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.
Note: 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. The t_sync subroutine 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; a process or an incoming event may change the provider's state after a t_sync subroutine call is issued.
If the provider is undergoing a state transition when the t_sync subroutine is called, the subroutine will be unsuccessful.
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:
If unsuccessful, the t_errno variable is set to one of the following:
This subroutine is part of Base Operating System (BOS) Runtime.
The dup subroutine, exec subroutine, fork subroutine, open subroutine.
List of Streams Programming References and STREAMS Overview in AIX Version 4.3 Communications Programming Concepts.