*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> esballoc (9r)              



NAME    [Toc]    [Back]

       esballoc  -  STREAMS:  Allocates  a  message  block with a
       shared buffer

SYNOPSIS    [Toc]    [Back]

       #include <sys/stream.h>

       mblk_t * esballoc(
               unsigned char *base,
               int size,
               int pri,
               frtn_t *free_rtnp );

ARGUMENTS    [Toc]    [Back]

       Specifies the address of the  user-supplied  data  buffer.
       Specifies  the number of bytes in the data buffer.  Specifies
 the priority of the allocation request (to be used by
       the  allocb  interface,  which esballoc calls).  Specifies
       the free interface (routine) data structure.

DESCRIPTION    [Toc]    [Back]

       The esballoc  interface  creates  a  STREAMS  message  and
       attaches a user-supplied data buffer in place of a STREAMS
       data buffer.  The interface calls allocb to obtain a  message
 and data block header. The user-supplied data buffer,
       pointed to by the base  argument,  is  used  as  the  data
       buffer for the message.

       The  free_rtn structure is referenced by the dp_freep member
 of the datab structure.  When the freeb  interface  is
       called  to  free  the  message,  the driver's message free
       interface (referenced through the free_rtn  structure)  is
       called, with arguments, to free the data buffer.

       The free_rtn structure is defined as follows:

       /*  Free  return  structure for esballoc */ typedef struct
       free_rtn {
         void    (*free_func)(char *, char *);  /*  Interface  to
       free buffer */
         char  *   free_arg;                      /* Parameter to
       free_func */ } frtn_t;

       Instead of requiring a specific number of  arguments,  the
       free_arg  member  is  of type char *. This way, the driver
       can pass a pointer to a structure if more than  one  argument
 is needed.

NOTES    [Toc]    [Back]

       The  free_func  interface  must be defined in kernel space
       and should be declared void. It has no  user  context  and
       must not sleep.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion, the esballoc interface returns
       a pointer to the newly allocated message block. This  message
  block is of type struct msgb *. The msgb data structure
 is defined in the /usr/sys/include/sys/stream.h file.

       On failure, esballoc returns a NULL pointer.

SEE ALSO    [Toc]    [Back]

       Kernel Interfaces: allocb(9r), freeb(9r)

       Programmer's Guide: STREAMS

[ Back ]
 Similar pages
Name OS Title
allocb Tru64 STREAMS: Allocates a message block
rmvb Tru64 STREAMS: Removes a message block from a message block
unlinkb Tru64 STREAMS: Removes a message block from the head of a message
freeb Tru64 STREAMS: Frees a message block
copyb Tru64 STREAMS: Copies a message block
msgb Tru64 Defines a STREAMS message block
rmvq Tru64 STREAMS: Removes a message block from a queue
dupb Tru64 STREAMS: Duplicates a message block descriptor
shmget Linux allocates a shared memory segment
MrmOpenHierarchyFromBuffer HP-UX Allocates a hierarchy ID and opens a buffer containing a memory image of a UID file
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service