DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

t_getstate(NET)


t_getstate -- get the current state

Synopsis

cc [options] file -lnsl
#include <xti.h>

int t_getstate(int fd);

Description

This function is an TLI/XTI local management routine used to return the current state of the provider associated with the transport endpoint specified by fd.

TLI/XTI states are changed by user events that reflect the success or failure of calls to the various TLI/XTI functions. Because fewer TLI/XTI user events occur over connectionless services, there are fewer TLI/XTI states than for connection-mode services.

The current state may be one of the following:


T_UNBND
unbound

T_IDLE
idle

T_OUTCON
outgoing connection pending (connection mode only)

T_INCON
incoming connection pending (connection mode only)

T_DATAXFER
data transfer (connection mode only)

T_OUTREL
outgoing orderly release (waiting for an orderly release indication) (connection mode only)

T_INREL
incoming orderly release (waiting for an orderly release request) (connection mode only)

Parameters


fd
the file descriptor for the transport endpoint associated with the current state.

State transitions

t_getstate may be issued from any valid state except T_UNINIT and has no effect on the state.

Files


/usr/lib/libxti.so
X/Open® Transport Interface Library (shared object)

/usr/lib/libnsl.so
Network Services Library (shared object)

Usage

The t_getstate function is applicable to both connection-mode and connectionless transport services.

Return values

t_getstate returns the current state on successful completion and -1 on failure and t_errno is set to indicate the error.

Errors

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

TBADF
The specified file descriptor 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.

TPROTO
A communication problem has been detected with the transport provider and there is no other value of t_errno to describe the error condition.

Warnings

If the provider is undergoing a state transition when t_getstate is called, the function will fail.

References

t_getinfo(NET), t_open(NET)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005