


T_SYNC(3N)              NETWORK FUNCTIONS              T_SYNC(3N)



NAME
     t_sync - synchronize transport library

SYNOPSIS
     #include <tiuser.h>

     int t_sync(fd)
     int fd;

DESCRIPTION
     For the transport endpoint specified by  _f_d,  t_sync()  syn-
     chronizes  the  data  structures  managed  by  the transport
     library with information from the underlying transport  pro-
     vider.   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 end-
     point, 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 _f_o_r_k_s a new process and issues  an
     _e_x_e_c,  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 coordi-
     nation is only valid among cooperating processes; it is pos-
     sible that a process or an incoming event could  change  the
     provider's state _a_f_t_e_r a t_sync() is issued.

     If the  provider  is  undergoing  a  state  transition  when
     t_sync() is called, the function will fail.

RETURN VALUES
     t_sync() returns -1 on failure.  Upon success, the state  of
     the  transport  provider  is  returned; it may be one of the
     following:

          T_IDLE         idle

          T_OUTCON       outgoing connection pending

          T_INCON        incoming connection pending

          T_DATAXFER     data transfer



Sun Release 4.1   Last change: 21 January 1990                  1






T_SYNC(3N)              NETWORK FUNCTIONS              T_SYNC(3N)



          T_OUTREL       outgoing orderly release (waiting for an
                         orderly release indication)

          T_INREL        incoming orderly release (waiting for an
                         orderly release request)

          T_UNBND        unbound

ERRORS
     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             The function  failed  due  to  a  system
                         error  and  set  errno  to  indicate the
                         error.

SEE ALSO
     dup(2V), execve(2V), fork(2V), open(2V)

     _N_e_t_w_o_r_k _P_r_o_g_r_a_m_m_i_n_g































Sun Release 4.1   Last change: 21 January 1990                  2



