Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

t_error() - output error message to the standard output

&pagelevel(4)&pagelevel

#include <xti.h>

int t_error(char *errmsg);
extern int t_errno;
extern char *t_errlist[];
extern int t_nerr;

Description

The user calls the t_error() function to write a self-formulated message describing the last error which occurred with an XTI function call, to the standard error output. his message, which describes the error in context, is passed in the errmsg parameter.

t_errlist is a vector of messages, which are each represented as a character string and allow user messages to be formatted. t_errno can be used as an index for this vector to receive a specific error message in string format (without end-of-line termination). t_nerr is the maximum index value for the t_errlist vector.

t_errno is set if an error occurs, however, it is not deleted for subsequent, successful calls.

The t_error() output comprises the error message passed by the user, followed by a colon (:) and the standard error output of the XTI function for the current value in t_errno. If t_errno has the value TSYSERR, t_error() also outputs the default error message for the current value in errno.

Return value

Always 0

Errors

No error codes are defined for t_error().

Example

If the t_connect() function on transport endpoint fd2 terminates with an error because an invalid address was specified, the error can follow the call below:

t_error("t_connect failed");

The following message is output:

t_connect failed: incorrect addr format

"t_connect failed" tells the user which function failed. "incorrect addr format" indicates the actual error which occurred.