Content-type: text/html Man page of t_sync

t_sync

Section: C Library Functions (3)
Index Return to Main Contents
 

NAME

t_sync - Synchronizes transport library  

LIBRARY

XTI Library (libxti.a)  

SYNOPSIS


#include <xti.h>

int t_sync(
    int fd) ;  

STANDARDS

Interfaces documented on this reference page conform to industry standards as follows:

t_sync:        XPG4-UNIX

Refer to the standards(5) reference page for more information about industry standards and associated tags.  

PARAMETERS

The following table summarizes the relevance of input parameter data before and after t_sync() is called:

ParameterBefore CallAfter Call

fdyn
Notes to Table:

y    This is a meaningful parameter.
n    This is not a meaningful parameter.
fd
Specifies a file descriptor returned by the t_open() function that identifies an active, uninitialized local transport endpoint.
 

VALID STATES

The t_sync() function can be called in any transport provider state except T_UNINIT.  

DESCRIPTION

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

The t_sync() function can be used to convert an uninitialized file descriptor, previously returned by the open() or dup() functions, or returned as the result of fork() or exec() functions, to an initialized transport endpoint. When the file descriptor references a valid transport endpoint, 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.

The t_sync() function returns the current state of the transport provider (refer to the t_getstate() function). Return of the current state of the transport provider permits the calling transport user to verify the transport provider state before issuing the next function call. This coordination is only valid among cooperating processes; it is possible that a process or an incoming event can change the transport provider state at the reference transport endpoint after t_sync() is called.

When the transport provider at the transport endpoint referenced by the fd parameter is undergoing a change of state and the t_sync() function is called, the t_sync() process fails and returns a [TSTATECHNG] error.  

RETURN VALUES

Upon successful completion, the state of the transport provider at the transport endpoint specified by the fd parameter is returned. Otherwise, a value of -1 is returned and t_errno is set to indicate the error. The returned state is one of the following:

[T_UNBND]
Transport endpoint not bound to an address.
[T_IDLE]
Transport endpoint is 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).

 

ERRORS

If the t_sync() function fails, t_errno may be set to one of the following values:

[TBADF]
File descriptor fd is not a valid transport endpoint. This error may be returned when the fd parameter has been previously closed or an erroneous file-descriptor value may have been passed to the call.
[TSTATECHNG]
The transport endpoint is undergoing a state change.
[TSYSERR]
A system error occurred during execution of this function.
[TPROTO]
This error indicates that a communication problem has been detected between XTI and the transport provider for which there is no other suitable XTI(t_errno).
 

RELATED INFORMATION

Functions: exec(2), fcntl(2), fork(2), open(2), t_getstate(3) delim off


 

Index

NAME
LIBRARY
SYNOPSIS
STANDARDS
PARAMETERS
VALID STATES
DESCRIPTION
RETURN VALUES
ERRORS
RELATED INFORMATION

This document was created by man2html, using the manual pages.
Time: 02:41:10 GMT, October 02, 2010