'\"macro stdmacro
.if n .pH g3n.t_close @(#)t_close	40.4 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} t_close 3N "Networking Support Utilities" "\&"
.if \nX=1 .ds x} t_close 3N "Networking Support Utilities"
.if \nX=2 .ds x} t_close 3N "" "\&"
.if \nX=3 .ds x} t_close "" "" "\&"
.if \nX=4 .ds x} t_close "NS_LIB" "EXTENSION" " "
.TH \*(x}
.SH NAME
\f4t_close\f1 \- close a transport endpoint
.SH SYNOPSIS
\f4#include <tiuser.h>\f1
.PP
\f4int t_close(fd)\f1
.br
\f4int fd;\f1
.SH DESCRIPTION
The \f4t_close\fP function informs the transport provider that the user
is finished with the transport endpoint specified by \f4fd\f1,
and frees any local library resources associated with the endpoint.
In addition, \f4t_close\fP
closes the file associated with the transport endpoint.
.PP
\f4t_close\fP should be called from the \f4T_UNBND\fP state [see
\f4t_getstate\fP(3N)].
However, this function does not check state information,
so it may be called from any state to close a transport endpoint.
If this occurs, the local library resources associated with the endpoint
will be freed automatically.
In addition,
\f4close\fP\s-1(2)\s+1
will be issued for that file descriptor; the close will be
abortive if no other process has that file open, and will break any
transport connection that may be associated with that endpoint.
.P
On failure, \f4t_errno\f1 may be set to the following:
.TP 13
\f4[TBADF]\fP
The specified file descriptor does not refer to a transport endpoint.
.SH SEE ALSO
t_\f4getstate\fP(3N),
t_\f4open\fP(3N),
t_\f4unbind\fP(3N).
.sp .2
\f2UNIX System V Network Programmer's Guide\f1.
.SH DIAGNOSTICS
\f4t_close\fP
returns 0 on success and \-1 on failure and
\f4t_errno\f1 is set to indicate the error.
.Ee
