1t_free(3NSL) Networking Services Library Functions t_free(3NSL)
2
3
4
6 t_free - free a library structure
7
9 #include <xti.h>
10
11
12
13
14 int t_free(void *ptr, int struct_type);
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_free() function frees memory previously allocated by
27 t_alloc(3NSL). This function will free memory for the specified struc‐
28 ture, and will also free memory for buffers referenced by the struc‐
29 ture.
30
31
32 The argument ptr points to one of the seven structure types described
33 for t_alloc(3NSL), and struct_type identifies the type of that struc‐
34 ture which must be one of the following:
35
36 T_BIND struct t_bind
37 T_CALL struct t_call
38 T_OPTMGMT struct t_optmgmt
39 T_DIS struct t_discon
40 T_UNITDATA struct t_unitdata
41 T_UDERROR struct t_uderr
42 T_INFO struct t_info
43
44
45
46 where each of these structures is used as an argument to one or more
47 transport functions.
48
49
50 The function t_free() will check the addr, opt and udata fields of the
51 given structure, as appropriate, and free the buffers pointed to by the
52 buf field of the netbuf structure. If buf is a null pointer, t_free()
53 will not attempt to free memory. After all buffers are freed, t_free()
54 will free the memory associated with the structure pointed to by ptr.
55
56
57 Undefined results will occur if ptr or any of the buf pointers points
58 to a block of memory that was not previously allocated by
59 t_alloc(3NSL).
60
62 Upon successful completion, a value of 0 is returned. Otherwise, a
63 value of -1 is returned and t_errno is set to indicate an error.
64
66 ALL - apart from T_UNINIT.
67
69 On failure, t_errno is set to the following:
70
71 TNOSTRUCTYPE Unsupported struct_type requested.
72
73
74 TPROTO This error indicates that a communication problem has
75 been detected between XTI and the transport provider
76 for which there is no other suitable XTI error
77 (t_errno).
78
79
80 TSYSERR A system error has occurred during execution of this
81 function.
82
83
85 The XTI and TLI interface definitions have common names but use differ‐
86 ent header files. This, and other semantic differences between the two
87 interfaces are described in the subsections below.
88
89 Interface Header
90 The XTI interfaces use the header file, xti.h. TLI interfaces should
91 not use this header. They should use the header:
92
93 #include <tiuser.h>
94
95
96 Error Description Values
97 The t_errno value that can be set by the XTI interface and cannot be
98 set by the TLI interface is:
99
100 TPROTO
101
102
104 See attributes(5) for descriptions of the following attributes:
105
106
107
108
109 ┌─────────────────────────────┬─────────────────────────────┐
110 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
111 ├─────────────────────────────┼─────────────────────────────┤
112 │MT Level │Safe │
113 └─────────────────────────────┴─────────────────────────────┘
114
116 t_alloc(3NSL), attributes(5)
117
118
119
120SunOS 5.11 7 May 1998 t_free(3NSL)