United States-English |
|
|
HP-UX Reference > Tt_error(3)HP-UX 11i Version 3: February 2007 |
|
NAMEt_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; DESCRIPTIONThe 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:
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 variable 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. EXAMPLESIf a t_connect() function fails on transport endpoint fd2 because a bad address was given, the following 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. |
Printable version | ||
|