t_open -- establish a transport endpoint


TLI syntax

cc . . . -lnsl

#include <sys/tiuser.h>

int t_open (path, oflag, info) char *path; int oflag; struct t_info *info;

XTI syntax

cc . . . -lxti

#include <xti.h>

int t_open (path, oflag, info) char *path; int oflag; struct t_info *info;


The t_open function must be called as the first step in the initialization of a transport endpoint. This function establishes a transport endpoint by opening a UNIX system file that identifies a particular transport provider (that is, transport protocol) and returning a file descriptor that identifies that endpoint. For example, opening the file /dev/iso_cots identifies an OSI connection-oriented transport layer protocol as the transport provider.

path points to the pathname of the file to open, and oflag identifies any open flags (as in open(S). t_open returns a file descriptor that is used by all subsequent functions to identify the particular local transport endpoint.

This function also returns various default characteristics of the underlying transport protocol by setting fields in the t_info structure. This argument points to the t_info(FP) structure.

The servtype member of t_info may specify one of the following values on return:

The transport provider supports a connectionless-mode service. For this service type, t_open returns -2 for etsdu, connect, and discon.

The transport provider supports a connection-mode service but does not support the optional orderly release facility.

The transport provider supports a connection-mode service with the optional orderly release facility.

A single transport endpoint may support only one of the above services at one time.

If info is set to NULL by the transport user, no protocol information is returned by t_open.

Porting considerations

XTI does not define the oflags O_RDONLY and O_WRONLY; O_RDWR must be used instead.

Return values

t_open returns a valid file descriptor on success and -1 on failure, and t_errno is set to indicate the error.


On failure, t_errno may be set to the following:

oflag is invalid; XTI only. The acceptable values are O_RDWR, or O_RDWR OR'ed with O_NONBLOCK.

The open of the specified path failed; XTI only. errno is set to ENOENT.

A system error occurred during execution of this function. One reason for this error is an I/O error; errno is then set to EIO.


t_open pushes the timod(M) STREAMS module on an opened stream head. The NUMTIM kernel parameter controls the maximum number of timod modules that can be pushed, and therefore limits the number of transport endpoints that can be opened.

See also

Intro(NET), open(S), t_info(FP), timod(M)

Standards conformance

t_open is conformant with:

AT&T SVID Issue 3 ;
X/Open CAE Specification, Networking Services, Issue 4, 1994. ;
and Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2) .

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003