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

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



NAME    [Toc]    [Back]

       allocb - STREAMS: Allocates a message block

SYNOPSIS    [Toc]    [Back]

       #include <sys/stream.h>

       MBLKP allocb(
               int size,
               uint pri );

ARGUMENTS    [Toc]    [Back]

       Specifies the number of bytes in the message block.  Specifies
 the priority of the request. You use  this  argument
       to determine if the allocation of memory blocks (waits) on
       the request. If you call the allocb interface  at  a  high
       priority  and  it  blocks on the request, the system could
       deadlock. Typically, you pass  the  constant  BPRI_WAITOK,
       which  signifies  that  allocb can block. If allocb cannot
       block, you should pass the BPRI_HI constant.

DESCRIPTION    [Toc]    [Back]

       The allocb interface attempts to allocate a  STREAMS  message
  block.  Buffer allocation fails only when the system
       is out of memory.  If no buffer is available, you can call
       the bufcall interface, which helps a module recover from a
       memory allocation failure.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion, the allocb interface returns a
       pointer to the 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.

       If  allocb  cannot  allocate a message block, it returns a
       NULL pointer.

SEE ALSO    [Toc]    [Back]

       Kernel Routines: bufcall(9r), esballoc(9r), testb(9r)

       Programmer's Guide: STREAMS

[ Back ]
 Similar pages
Name OS Title
esballoc Tru64 STREAMS: Allocates a message block with a shared buffer
rmvb Tru64 STREAMS: Removes a message block from a message block
unlinkb Tru64 STREAMS: Removes a message block from the head of a message
copyb Tru64 STREAMS: Copies a message block
msgb Tru64 Defines a STREAMS message block
freeb Tru64 STREAMS: Frees a message block
dupb Tru64 STREAMS: Duplicates a message block descriptor
rmvq Tru64 STREAMS: Removes a message block from a queue
insq Tru64 STREAMS: Inserts a STREAMS message into a queue
datamsg Tru64 STREAMS: Tests whether a message is a data message
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service