t_error(3xti)
t_error --
write an error message
Synopsis
cc [options] file -lnsl
#include <xti.h>
int t_error(char *errmsg);
Description
This function is a TLI/XTI local management routine used to generate
a message under error conditions.
t_error writes a message on the standard error file
describing the last error encountered
during a call to a TLI/XTI function.
The argument string errmsg is user supplied and
may be set to give context to the error.
The message returned by t_error prints in the following format:
the user-supplied error message followed by a colon and
the standard transport function error message for the current value
contained in t_errno.
Parameters
errmsg-
a user-supplied error message that gives context to the error.
t_errno-
index to a user-specified message array.
t_errlist-
points to the array of user-supplied message strings.
t_nerr-
maximum number of messages in the user-specified message array.
State transitions
t_error may be issued from any valid state except T_UNINIT
and has no effect on the entry state at exit.
Files
/usr/lib/libxti.so-
X/Open® Transport Interface Library (shared object)
/usr/lib/libnsl.so-
Network Services Library (shared object)
/usr/lib/locale/locale/LC_MESSAGES/uxnsl-
Usage
On return, t_errno is set only when an error occurs
and is not cleared on subsequent successful calls.
If the returned value of t_errno has been set to
TSYSERR, t_error will also print the standard error message
for the current value contained in errno (see
intro(2)).
Return values
Upon completion, a value of 0 is returned.
No errors are defined.
References
intro(2),
t_strerror(3xti)
Examples
Following a t_connect function call, which might fail on
a transport endpoint fd2 because a bad address was detected, a call
to t_error might be issued to check for a possible failure:
t_error("t_connect failed on fd2");
If the t_connect fails, t_errno is set to
the appropriate value, and 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
identifies the specific error that occurred.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004