Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ t_sync(3) — Macintosh Execution Environment 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

t_open(3)

t_getstate(3)

dup(2)

exec(2)

fork(2)

open(2)

t_sync(3)

NAME

t_sync − synchronize transport library

SYNOPSIS

#include <xti.h>     (for XTI)

or

#include <tiuser.h>  (for TLI)

 
int t_sync (fd)
int fd;

 

DESCRIPTION

The t_sync() utility service function is used to synchronize data structures managed by the transport library with information from the underlying transport provider. 

t_sync is also used to convert an uninitialized file descriptor, previously returned by the open(2) or dup(2) functions, or returned as the result of fork(2) or exec(2) functions, to an initialized transport endpoint.  When the file descriptor references a valid transport endpoint, the necessary library data structures are allocated and updated. 

The t_sync function also permits two cooperating processes to synchronize their interaction with a transport provider.  When a process forks, for example, and an exec function is issued, the child (new) process must call the t_sync function to build a private library data structure associated with the transport endpoint referenced by the fd parameter and to synchronize the library data structure with relevant transport provider information. 

A transport provider treats multiple users of a transport endpoint as the same user.  When more than one process is using the same transport endpoint, each should coordinate its activities so that operation does not conflict with the transport provider state at the transport endpoint specified by fd.

For the transport endpoint specified by fd, t_sync returns the current state of the transport connection 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 endpoint’s state after a t_sync is issued. 
 
If the transport endpoint is undergoing a state transition when t_sync is called, t_sync will fail and will return [TSTATECHNG]. 
 

ERRORS

On failure, t_errno is set to one of the following:

­[TBADF] The specified file descriptor does not refer to a transport endpoint. 

­[TSTATECHNG] The transport endpoint is undergoing a state change. 

­[TSYSERR] A system error has occurred during execution of this function. 
 

RETURN VALUE

t_sync returns the state of the transport connection endpoint on successful completion and -1 on failure, and t_errno is set to indicate the error.  The state returned is 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)

NOTE

In HP-UX 9.0, XTI (X/Open Transport Interface) supports only OSI as a transport provider, and is available only as part of the OSI Transport Services 9000 product. Users of this product can access XTI versions of the t_* routines by linking with /usr/lib/libxti.a.  For more information on XTI, see "HP-UX/9000 XTI Programmer’s Guide". 

In HP-UX 9.0, TLI (Transport Layer Interface) supports any transport provider which is compliant with TPI (Transport Provider Interface).  TLI is available only as part of the STREAMS product.  Users of this product can access TLI versions of the t_* routines by linking with /usr/lib/libnsl_s.a.  For more information on TLI, see the TLI section of "STREAMS/UX for HP 9000 Reference Manual". 

SEE ALSO

t_open(3), t_getstate(3), dup(2), exec(2), fork(2), open(2). 

Hewlett-Packard Company  —  HP-UX Release 9.0: October 1992

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