Manual Page Result
0
Command: t_sync | Section: 3 | Source: Digital UNIX | File: t_sync.3.gz
t_sync(3) Library Functions Manual t_sync(3)
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 stan-
dards as follows:
t_sync: XPG4-UNIX
Refer to the standards(5) reference page for more information about in-
dustry standards and associated tags.
PARAMETERS
The following table summarizes the relevance of input parameter data
before and after t_sync() is called:
center, tab(@); lb lb lb c c c. Parameter@Before Call@After Call
_
fd@y@n
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 end-
point.
VALID STATES
The t_sync() function can be called in any transport provider state ex-
cept 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 de-
scriptor, previously returned by the open() or dup() functions, or re-
turned as the result of fork() or exec() functions, to an initialized
transport endpoint. When the file descriptor references a valid trans-
port endpoint, necessary library data structures are allocated and up-
dated.
The t_sync() function also permits two cooperating processes to syn-
chronize 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 end-
point 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 trans-
port 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. Other-
wise, a value of -1 is returned and t_errno is set to indicate the er-
ror. 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 in-
dication).
[T_INREL] Incoming orderly release (waiting for an orderly release re-
quest).
ERRORS
If the t_sync() function fails, t_errno may be set to one of the fol-
lowing values:
[TBADF]
File descriptor fd is not a valid transport endpoint. This er-
ror 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 de-
tected 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
t_sync(3)