Closes a transport end point.
Transport Layer Interface Library (libtli.a)
#include <tiuser.h>
int t_close(fd)
int fd;
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.
Item | Description |
---|---|
fd | Specifies the transport end point to be closed. |
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.
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. |