t_getstate() — Get the current state

Standards

Standards / Extensions C or C++ Dependencies
XPG4.2 both  

Format

#define _XOPEN_SOURCE_EXTENDED 1
#include <xti.h>

int t_getstate(int fd);

General description

Returns the current state of the provider associated with the transport endpoint specified by fd.

Valid states: All - except for T_UNINIT

Returned value

If successful, t_getstate() returns the state. The current state is one of the following:
T_DATAXFER
Data transfer.
T_IDLE
Idle.
T_INCON
Incoming connection pending.
T_OUTCON
Outgoing connection pending.
T_UNBND
Unbound.

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

If unsuccessful, t_getstate() returns -1 and sets errno to one of the following values:
Error Code
Description
TBADF
The specified file descriptor does not refer to a transport endpoint.
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).
TSTATECHNG
The transport provider is undergoing a transient state change.
TSYSERR
A system error has occurred during execution of this function.

Related information