t_error.3 (2010 09)

t
t_error(3) t_error(3)
NAME
t_error() - produce error message
SYNOPSIS
#include <xti.h> /* for X/OPEN Transport Interface - XTI */
/* or */
#include <tiuser.h> /* for Transport Layer Interface - TLI */
void t_error (errmsg);
char *errmsg;
extern int t_errno;
extern char *t_errlist[];
extern int t_nerr;
DESCRIPTION
The t_error() function produces a language-dependent message on the standard error output 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 error message is written as follows:
First if errmsg is not a null pointer and the character pointed to be errmsg is not the null character,
the string pointed to by errmsg is written followed by a colon and a space.
Then a standard error message string for the current error defined in
t_errno is written. If
t_errno has a value different from [TSYSERR], the standard error message string is followed by a
newline character. If, however, t_errno is equal to [TSYSERR], the t_errno string is followed
by the standard error message string for the current error defined in errno followed by a newline.
The language for error message strings written by
t_error() is implementation-defined. If it is in
English, the error message string describing the value in t_errno is identical to the comments following
the t_errno codes defined in <xti.h>. The contents of the error message strings describing the value
in errno are the same as those returned by the strerror() function with an argument of
errno.
To simplify variant formatting of messages, the array of message strings
t_errlist is provided;
t_errno can be used as an index in this table to get the message string without the newline. The vari-
able t_nerr is the largest message number provided for in the t_errlist table.
The error number,
t_errno, is only set when an error occurs and it is not cleared on successful calls.
Valid States
All - apart from
T_UNINIT.
Fork Safety
t_error is not fork-safe.
RETURN VALUE
For XTI, upon completion, a value of 0 is returned. TLI does not return a value.
ERRORS
No errors are defined for the
t_error() function.
EXAMPLES
If a
t_connect() function fails on transport endpoint fd2 because a bad address was given, the follow-
ing call might follow the failure:
t_error("t_connect failed on fd2");
The diagnostic message to be printer would look like:
t_connect failed on fd2: Incorrect address format
where Incorrect address format identifies the specific error that occurred, and t_connect
failed on fd2 tells the user which function failed on which transport endpoint.
FILES
/usr/lib/nls/msg/C/libnsl_s.cat NLS message catalog for TLI
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)