Establish a transport endpoint.
X/Open Transport Interface Library (libxti.a)
#include <xti.h>
#include <fcntl.h>
int t_open (
const char *name;
int oflag;
struct t_info *info)
The t_open subroutine must be called as the first step in the initialization of a transport endpoint. This subroutine establishes a transport endpoint by supplying a transport provider identifier that indicates a particular transport provider (for example, transport protocol) and returning a file descriptor that identifies that endpoint.
This subroutine also returns various default characteristics of the underlying transport protocol by setting fields in the t_info structure.
| Item | Description |
|---|---|
| name | Points to a transport provider identifier. |
| oflag | Identifies any open flags (as in the open exec) . The oflag parameter is constructed from O_RDWR optionally bitwise inclusive-OR-ed with O_NONBLOCK. These flags are defined by the fcntl.h header file. The file descriptor returned by the t_open subroutine is used by all subsequent subroutines to identify the particular local transport endpoint. |
| info | Points to a t_info structure which contains the following
members:
The values of the fields have the following meanings:
|
If a transport user is concerned with protocol independence, the above sizes may be accessed to determine how large the buffers must be to hold each piece of information. Alternatively, the t_alloc subroutine may be used to allocate these buffers. An error will result if a transport user exceeds the allowed data size on any subroutine. If the info parameter is set to a null pointer by the transport user, no protocol information is returned by the t_open subroutine. |
T_UNINIT
| Item | Description |
|---|---|
| Valid file descriptor | Successful completion. |
| -1 | t_errno is set to indicate an error. |
On failure, t_errno is set to one of the following:
| Value | Description |
|---|---|
| TBADFLAG | An invalid flag is specified. |
| TBADNAME | Invalid transport provider name. |
| TSYSERR | A system error has occurred during execution of this subroutine. |
| TPROTO | This error indicates that a communication problem has been detected between the X/Open Transport Interface and the transport provider for which there is no other suitable X/Open Transport Interface (t_errno). |