1t_error(3NSL) Networking Services Library Functions t_error(3NSL)
2
3
4
6 t_error - produce error message
7
9 #include <xti.h>
10
11
12
13
14 int t_error(const char *errmsg);
15
16
18 This routine is part of the XTI interfaces which evolved from the TLI
19 interfaces. XTI represents the future evolution of these interfaces.
20 However, TLI interfaces are supported for compatibility. When using a
21 TLI routine that has the same name as an XTI routine, the tiuser.h
22 header file must be used. Refer to the TLI COMPATIBILITY section for
23 a description of differences between the two interfaces.
24
25
26 The t_error() function produces a message on the standard error output
27 which describes the last error encountered during a call to a transport
28 function. The argument string errmsg is a user-supplied error message
29 that gives context to the error.
30
31
32 The error message is written as follows: first (if errmsg is not a null
33 pointer and the character pointed to be errmsg is not the null charac‐
34 ter) the string pointed to by errmsg followed by a colon and a space;
35 then a standard error message string for the current error defined in
36 t_errno. If t_errno has a value different from TSYSERR, the standard
37 error message string is followed by a newline character. If, however,
38 t_errno is equal to TSYSERR, the t_errno string is followed by the
39 standard error message string for the current error defined in errno
40 followed by a newline.
41
42
43 The language for error message strings written by t_error() is that of
44 the current locale. If it is English, the error message string
45 describing the value in t_errno may be derived from the comments fol‐
46 lowing the t_errno codes defined in xti.h. The contents of the error
47 message strings describing the value in errno are the same as those
48 returned by the strerror(3C) function with an argument of errno.
49
50
51 The error number, t_errno, is only set when an error occurs and it is
52 not cleared on successful calls.
53
55 If a t_connect(3NSL) function fails on transport endpoint fd2 because a
56 bad address was given, the following call might follow the failure:
57
58 t_error("t_connect failed on fd2");
59
60
61
62 The diagnostic message to be printed would look like:
63
64 t_connect failed on fd2: incorrect addr format
65
66
67
68 where incorrect addr format identifies the specific error that
69 occurred, and t_connect failed on fd2 tells the user which function
70 failed on which transport endpoint.
71
73 Upon completion, a value of 0 is returned.
74
76 All - apart from T_UNINIT
77
79 No errors are defined for the t_error() function.
80
82 The XTI and TLI interface definitions have common names but use differ‐
83 ent header files. This, and other semantic differences between the two
84 interfaces are described in the subsections below.
85
86 Interface Header
87 The XTI interfaces use the header file, xti.h. TLI interfaces should
88 not use this header. They should use the header:
89
90 #include <tiuser.h>
91
92
93 Error Description Values
94 The t_errno value that can be set by the XTI interface and cannot be
95 set by the TLI interface is:
96
97
98 TPROTO
99
101 See attributes(5) for descriptions of the following attributes:
102
103
104
105
106 ┌─────────────────────────────┬─────────────────────────────┐
107 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
108 ├─────────────────────────────┼─────────────────────────────┤
109 │MT Level │Safe │
110 └─────────────────────────────┴─────────────────────────────┘
111
113 t_errno(3NSL)strerror(3C), attributes(5)
114
115
116
117SunOS 5.11 7 May 1998 t_error(3NSL)