Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

t_sync() - synchronize transport library

&pagelevel(4)&pagelevel

#include <xti.h>

int t_sync(int fd);

Description

The user can synchronize the data structures for the transport endpoint specified by fd, which are managed by the transport library, with information of the underlying transport provider using the t_sync() function. t_sync() also allows two cooperating processes to synchronize their interaction with the transport provider.

For example, if a process creates a new process and calls exec(), the new process must call the t_sync() function to

  • build up the private library data structure which is bound to a transport endpoint and

  • synchronize the data structure with relevant transport provider information.

It must be noted that the transport provider sees all users of a transport endpoint as a single user. Therefore, if several user processes use the same transport endpoint, they should coordinate their tasks such that the transport provider does not end up in a faulty state. To do this, the separate user processes can call t_sync() to get the current state of the transport provider before initiating further actions.

Coordination with t_sync() is only allowed between cooperating processes as it is possible that a process or incoming event can change the state of the transport provider after t_sync() was executed.

Return value

After successful execution, t_sync() returns the state of the transport provider.

If an error occurs, -1 is returned and t_errno is set to indicate the error.

The following transport provider states are possible as t_sync() return values:

T_UNBND

The transport endpoint is not bound to the transport service.

T_IDLE

The transport endpoint is bound to the transport service.

T_OUTCON

A sent connection request has not been processed yet.

T_INCON

A connection request which arrived has not been processed yet.

T_DATAXFER

Data transfer phase.

T_OUTREL

A request for orderly connection shutdown was sent (wait for indication of an orderly connection shutdown).

T_INREL

Wait for a request for orderly connection shutdown.

Errors

TBADF

The specified file descriptor does not reference a transport endpoint.

TSTATECHNG

The transport provider is changing state.

TSYSERR

A system error occurred during execution of this function.

See also

dup(), exec(), fork() and open() in "C Library Functions for POSIX Applications"