cc [ flag ... ] file ... -lnsl [ library ... ]
#include <tiuser.h>
int t_free(char *ptr, int struct_type);
MT-Safe
ptr points to one of the six structure types described for t_alloc(3N) , and struct_type identifies the type of that structure, which can be one of the following:
where each of these structures is used as an argument to one or more transport functions.
t_free() will check the addr, opt, and udata fields of the given structure (as appropriate), and free the buffers pointed to by the buf field of the netbuf (see t_connect(3N) ) structure. If buf is NULL , t_free() will not attempt to free memory. After all buffers are freed, t_free() will free the memory associated with the structure pointed to by ptr.
Undefined results will occur if ptr or any of the buf pointers points to a block of memory that was not previously allocated by t_alloc(3N) .
On failure, t_errno will be set to the following: