Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ t_error(3) — Macintosh Execution Environment 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

t_error(3)

NAME

t_error − produce error message

SYNOPSIS

For XTI:


#include <xti.h>
 int t_error (errmsg)

 

For TLI:


#include <tiuser.h>
 void t_error (errmsg)

 

For both:

 
char *errmsg;
extern int t_errno
extern char *t_errlist[]
extern int t_nerr;

 

DESCRIPTION

The t_error function 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 context to the error. 

The user supplied error message is printed, followed by a colon and a standard error message for the current error defined in t_errno.  If t_errno is [TSYSERR], t_error() will also print a standard error message for the current value contained in errno For XTI, see Volume 2, XSI System Interface and Headers Chapter 3.  For TLI, see errno(2). 
 
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. 

EXAMPLE

If 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. 
 

ERRORS

For XTI only, if the function t_error() fails, the variable t_errno is set to the following:

­[TNOTSUPPORT] This function is not supported by the underlying transport provider. 

RETURN VALUE

For XTI, upon successful completion, a value of 0 is returned.  Otherwise, a value of -1 is returned, and t_errno is set to indicate the error.  For TLI, t_error does not return a value, and does not change the value of t_errno. 

FILES

­/usr/lib/nls/C/libnsl_s.cat NLS message catalog for TLI

NOTE

In HP-UX 9.0, XTI (X/Open Transport Interface) supports only OSI as a transport provider, and is available only as part of the OSI Transport Services 9000 product. Users of this product can access XTI versions of the t_* routines by linking with /usr/lib/libxti.a.  For more information on XTI, see "HP-UX/9000 XTI Programmer’s Guide". 

In HP-UX 9.0, TLI (Transport Layer Interface) supports any transport provider which is compliant with TPI (Transport Provider Interface).  TLI is available only as part of the STREAMS product.  Users of this product can access TLI versions of the t_* routines by linking with /usr/lib/libnsl_s.a.  For more information on TLI, see the TLI section of "STREAMS/UX for HP 9000 Reference Manual". 

Hewlett-Packard Company  —  HP-UX Release 9.0: October 1992

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