#include <tiuser.h>
int t_sync(fd) int fd;
For the transport endpoint specified by fd, t_sync() 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 using open.2v dup.2v or as a result of a fork.2v and execve.2v to an initialized transport endpoint, assuming that file descriptor referenced a transport provider. t_sync() also allows two cooperating processes to synchronize their interaction with a transport provider.
For example, if a process forks a new process and issues an exec, the new process must issue a t_sync() to build the private library data structure associated with a transport endpoint and to synchronize the data structure 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. t_sync() 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 t_sync() is issued.
If the provider is undergoing a state transition when t_sync() is called, the function will fail.
t_sync() returns -1 on failure. Upon success, the state of the transport provider is returned; it may be one of the following:
[a manual with the abbreviation NETP]
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97