Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ t_sync(NSL) — System V/386 Software Development System 3.2.2b

Media Vault

Software Library

Restoration Projects

Artifacts Sought

     Name
          t_sync - synchronize transport library

     Syntax
          #include <tiuser.h>

          int t_sync(fd)
          int fd;

     Description
          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 via open(S), dup(S), or as a result of a fork(S)
          and exec(S)] to an initialized transport endpoint, assuming
          that file descriptor referenced a transport provider.  This
          function 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.

          On failure, t_errno may be set to one of the following:

          [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.

     See Also
          dup(S), exec(S), fork(S), open(S) in the XENIX Reference.
          Network Programmer's Guide.

     Diagnostics
          The t_sync function returns the state of the transport
          provider on successful completion and -1 on failure, and
          t_errno is set to indicate the error.  The state returned
          may be one of the following:

          T_UNBND            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).

     Standards Conformance
          t_sync is conformant with:
          AT&T SVID Issue 2, Select Code 307-127.

                                                (printed 6/18/89)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026