[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    t_open(3N) manual page Table of Contents

Name

t_open - establish a transport endpoint

Synopsis

cc [ flag ... ] file ... -lnsl [ library ... ]


#include <tiuser.h>
#include <fcntl.h>

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

MT-Level

MT-S afe

Description

t_open() must be called as the first step in the initialization of a transport endpoint. This function establishes a transport endpoint by opening a 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 path name of the file to open, and oflag identifies any open flags (as in open(2) ). oflag may be constructed from O_NDELAY or O_NONBLOCK OR-ed with O_RDWR . These flags are defined in the header <fcntl.h>. t_open() returns a file descriptor that will be 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. See t_getinfo(3N) for a description of the t_info structure.

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

Return Values

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

Errors

On failure, t_errno will be set to the following:

TBADFLAG
An invalid flag is specified.
TSYSERR
A system error has occurred during execution of this function, errno will be set to the specific error.

See Also

open(2) , t_getinfo(3N)

Notes

This interface is safe in multithreaded applications.


Table of Contents