t_error(S) (TLI/XTI) 6 January 1993 t_error(S) Name t_error - produce error message Syntax TLI syntax cc . . . -lnsls #include <sys/tiuser.h> void t_error (errmsg) char *errmsg; extern int t_errno; extern char *t_errlist[]; extern int t_nerr; XTI syntax cc . . . -lxti #include <xti.h> void t_error (errmsg) char *errmsg; extern int t_errno; extern char *t_errlist[]; extern int t_nerr; Description terror produces a 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 con- text to the error. terror prints the user-supplied error message followed by a colon and the standard transport function error message for the current value con- tained in terrno. If terrno is TSYSERR, terror will also print the standard error message for the current value contained in errno (see netbuf(FP)). terrlist is the array of message strings, to allow user message format- ting. terrno can be used as an index into this array to retrieve the error message string (without a terminating newline). tnerr is the max- imum index value for the terrlist array. terrno is set when an error occurs and is not cleared on subsequent suc- cessful calls. Example If a tconnect 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 would print 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 identi- fies the specific error that occurred. Standards conformance terror is conformant with: AT&T SVID Issue 2; X/Open Portability Guide, Issue 3, 1989; and Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2).