terror(3) CLIX terror(3)
NAME
t_error - Produces an error message
LIBRARY
Transport Layer Interface (TLI) Library (libnsl_s.a)
SYNOPSIS
#include <tiuser.h>
void t_error(
char *errmsg );
extern int t_errno;
extern char *t_errlist[];
extern int t_nerr;
PARAMETERS
errmsg A pointer to a string representing an error message
DESCRIPTION
The t_error() function produces a message on stderr which describes the
last error encountered during a call to a transport function. The
argument string errmsg is a user-supplied error message that gives context
to the error.
The t_error() function displays the user-supplied error message followed
by a colon and the standard, transport function error message for the
current value contained in t_errno. If t_errno is SYSERR, t_error() will
also display the standard error message for the current value contained in
errno [see intro].
The t_errlist is the array of message strings which allows user message
formatting. The t_errno can be used as an index into this array to
retrieve the error message string (without a terminating newline). The
t_nerr is the maximum index value for the t_errlist array.
The t_errno is set when an error occurs and is not cleared on subsequent
successful calls.
EXAMPLES
If a t_connect() function fails on transport endpoint fd2 because a bad
address was given, the following call might follow the failure:
2/94 - Intergraph Corporation 1
terror(3) CLIX terror(3)
t_error("t_connect failed on fd2");
RETURN VALUES
The diagnostic message would display as:
t_connect failed on fd2: Incorrect transport address format
where ``t_connect failed on fd2'' tells the user which function failed on
which transport endpoint, and ``Incorrect transport address format''
identifies the specific error that occurred.
RELATED INFORMATION
AT&T UNIX System V Network Programmer's Guide.
2 Intergraph Corporation - 2/94