'\" te .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved .TH allocb_tmpl 9F "16 Jan 2006" "SunOS 5.11" "Kernel Functions for Drivers" .SH NAME allocb_tmpl \- allocate a message block using a template .SH SYNOPSIS .LP .nf #include \fBmblk_t *\fR\fBallocb_tmpl\fR(\fBsize_t\fR \fIsize\fR, \fBconst mblk_t *\fR\fItmpl\fR); .fi .SH INTERFACE LEVEL .sp .LP Solaris DDI specific (Solaris DDI) .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIsize\fR\fR .ad .RS 8n .rt The number of bytes in the message block. .RE .sp .ne 2 .mk .na \fB\fItmpl\fR\fR .ad .RS 8n .rt The template message block. .RE .SH DESCRIPTION .sp .LP The \fBallocb_tmpl()\fR function tries to allocate a STREAMS message block using \fBallocb\fR(9F). If the allocation is successful, the \fBdb_type\fR field in the data block structure (\fBdblk_t\fR, see \fBdatab\fR(9S)), as well as some implementation-private data, are copied from the \fBdblk_t\fR associated with \fItmpl\fR. .sp .LP The \fBallocb_tmpl()\fR function should be used when a new STREAMS message block is allocated. This block is then used to contain data derived from another STREAMS message block. The original message is used as the \fItmpl\fR argument. .SH RETURN VALUES .sp .LP Upon success, \fBallocb_tmpl()\fR returns a pointer to the allocated message block of the same type as \fItmpl\fR. On failure, \fBallocb_tmpl()\fR returns a NULL pointer. .SH CONTEXT .sp .LP The \fBallocb_tmpl()\fR function can be called from user, interrupt, or kernel context. .SH SEE ALSO .sp .LP \fBallocb\fR(9F), \fBdatab\fR(9S), \fBmsgb\fR(9S) .sp .LP \fIWriting Device Drivers for Oracle Solaris 11.2\fR .sp .LP \fISTREAMS Programming Guide\fR