Error handling
XTI
attempts to separate communications errors from system
errors by defining two levels of errors:
-
Library level errors.
Each library function has one or more error returns and indicates
failure with a -1.
An external integer,
t_errno,
holds the specific error number when such an failure occurs.
This value is set when errors occur but is not cleared by successful
library calls.
It should therefore be tested only after an error has been indicated.
A diagnostic function,
t_error,
is provided for printing out information on the current transport
error.
-
System errors.
The standard external variable
errno,
is used to report system errors.
Such errors can, of course, affect
XTI
functioning.
When they do,
t_errno
is set to
TSYSERR
and
errno
is set to show the specific system error that occurred.
The state
of the transport provider may change if a transport error occurs.
The socket interface provides a similar facility with
getsockopt
when called with an option of
SO_ERROR.
NOTE:
In applications linked with the Threads Library, distinct instances of
t_errno
and
errno
will be supported for each thread.
See
``Multithreaded network programming''
for more information about using the Transport Interface
and the Socket Interface with the Threads Library.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004