Query: allocb_tmpl
OS: sunos
Section: 9f
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
allocb_tmpl(9F) Kernel Functions for Drivers allocb_tmpl(9F)NAMEallocb_tmpl - allocate a message block using a templateSYNOPSIS#include <sys/stream.h> mblk_t *allocb_tmpl(size_t size, const mblk_t *tmpl);INTERFACE LEVELSolaris DDI specific (Solaris DDI)PARAMETERSsize The number of bytes in the message block. tmpl The template message block.DESCRIPTIONThe allocb_tmpl() function tries to allocate a STREAMS message block using allocb(9F). If the allocation is successful, the db_type field in the the data block structure (dblk_t, see datab(9S)), as well as some implementation-private data, are copied from the dblk_t associated with tmpl. allocb_tmpl() 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 tmpl argument.RETURN VALUESUpon success, allocb_tmpl() returns a pointer to the allocated message block of the same type as tmpl. On failure, allocb_tmpl() returns a NULL pointer.CONTEXTallocb_tmpl() can be called from user or interrupt context.SEE ALSOallocb(9F), datab(9S), msgb(9S) Writing Device Drivers STREAMS Programming Guide SunOS 5.10 18 Feb 2003 allocb_tmpl(9F)