Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > T

t_error(3)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

t_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;

DESCRIPTION

The 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:

  • First if errmsg is not a null pointer and the character pointed to be errmsg is not the null character, the string pointed to by errmsg is written followed by a colon and a space.

  • Then a standard error message string for the current error defined in t_errno is written. If t_errno has a value different from [TSYSERR], the standard error message string is followed by a newline character. If, however, t_errno is equal to [TSYSERR], the t_errno string is followed by the standard error message string for the current error defined in errno followed by a newline.

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.

Valid States

All - apart from T_UNINIT.

Fork Safety

t_error is not fork-safe.

RETURN VALUE

For XTI, upon completion, a value of 0 is returned. TLI does not return a value.

ERRORS

No errors are defined for the t_error() function.

EXAMPLES

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.

FILES

/usr/lib/nls/msg/C/libnsl_s.cat

NLS message catalog for TLI

STANDARDS CONFORMANCE

t_error(): SVID2, XPG3, XPG4

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.