t_close Subroutine for Transport Layer Interface

Purpose

Closes a transport end point.

Library

Transport Layer Interface Library (libtli.a)

Syntax

#include <tiuser.h>

int t_close(fd)
int  fd;

Description

The t_close subroutine informs the transport provider that the user is finished with the transport end point specified by the fd parameter and frees any local library resources associated with the end point. In addition, the t_close subroutine closes the file associated with the transport end point.

The t_close subroutine should be called from the T_UNBND state (see the t_getstate subroutine). However, this subroutine does not check state information, so it may be called from any state to close a transport end point. If this occurs, the local library resources associated with the end point are freed automatically. In addition, the close subroutine is issued for that file descriptor. The close subroutine is abortive if no other process has that file open, and will break any transport connection that may be associated with that end point.

Parameter

Item Description
fd Specifies the transport end point to be closed.

Return Values

On successful completion, the t_connect subroutine returns a value of 0. Otherwise, it returns a value of -1, and the t_errno variable is set to indicate the error.

Error Code

If unsuccessful, the t_errno variable is set to the following:

Value Description
TBADF The specified file descriptor does not refer to a transport end point.