.TH free_rtn "" "" "STREAMS Data Structure"
.PC "Structure for STREAMS message-free routine"
.B "#include <sys/stream.h>"
.PP
The structure
.B free_rtn
holds information on how to invoke the driver's function for freeing a
message buffer.
When a driver calls routine
.B esballoc()
to allocate a message,
.B esballoc()
creates a copy of
.B free_rtn
and links it to the message.
Thus, when routine
.B freeb()
is called to free the message and the message's reference count drops to zero,
.B freeb()
reads
.B free_rtn
and uses the information therein to invoke
the driver's routine for freeing the data buffer.
.PP
The following fields within
.B free_rtn
are available to a driver:
.IP "\fBvoid (*free_func)()\fR" 1.25i
This points to the driver's function that frees the data buffer.
When this function runs, interrupts from all \*(ST devices are blocked.
.I free_func
has no user context and so cannot call any routine that sleeps,
or access any dynamically allocated data structures
that may no longer exist when it runs.
.IP "\fBchar *free_arg\fR"
This points to an argument to pass to
.BR free_func .
This function can take only one argument, a pointer to a string,
it can use this argument creatively.
.SH "See Also"
.B
DDI/DKI data structures,
freeb()
.R
