Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

t_error(3xti)

Name

t_error − produces error message

Syntax

#include <xti.h>
int t_error(errmsg)
char *errmsg;
extern char *t_errlist[];
extern int t_nerr;

Arguments

errmsgIs a user-supplied error message that gives context to the error. 

Description

The t_error() function produces a message on the standard error output that describes the last error encountered during a call to a transport function.

The t_error() function prints the user-supplied error message followed by a colon and a standard error message for the current error defined in t_errno. If t_errno is [TSYSERR], t_error() also prints a standard message for the current value contained in 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 t_nerr is the largest message number provided for in the t_errlist table. 

The t_errno variable is set only when an error occurs and is not cleared on successful calls. 

Parameters Before Call After Call
errmsg x /

Examples

If a t_connect() function fails on transport endpoint fd2 because a bad address was given, the following call may follow the failure:

t_error ("t_connect failed on fd"):

The diagnostic message to be printed would look like:

t_connect failed on fd2: Incorrect transport address format

where "Incorrect transport address format" identifies the specific error that occurred, and "t_connect failed on fd2" tells the user which function failed on which transport endpoint.

Return Values

Upon successful completion, a value of 0 is returned. On failure, a value of −1 is returned, and t_errno is set to indicate the error. 

Diagnostics

On failure, t_errno is set to the following:

[TNOTSUPPORT] This function is not supported by the current implementation of XTI. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026