allocb(9r)allocb(9r)NAME
allocb - STREAMS: Allocates a message block
SYNOPSIS
#include <sys/stream.h>
MBLKP allocb(
int size,
uint pri );
ARGUMENTS
Specifies the number of bytes in the message block. Specifies the priority of the request. You use this argument to determine if the allo-
cation of memory blocks (waits) on the request. If you call the allocb interface at a high priority and it blocks on the request, the sys-
tem 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
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
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
Kernel Routines: bufcall(9r), esballoc(9r), testb(9r)
Programmer's Guide: STREAMS
allocb(9r)
Check Out this Related Man Page
bufcall(9r)bufcall(9r)NAME
bufcall - STREAMS: Gets a buffer when allocb fails
SYNOPSIS
#include <sys/stream.h>
int bufcall(
int size,
int pri,
int (*function) (),
long argument );
ARGUMENTS
Specifies the number of bytes in the buffer. Specifies the priority of the allocb allocation request (no longer used). Specifies a kernel
or driver interface to be called when a buffer becomes available. Specifies an argument to be passed to the kernel or driver interface
specified in the function argument.
DESCRIPTION
The bufcall interface serves as a timeout call of indeterminate length. When a buffer allocation request fails, you can use bufcall to
schedule the interface passed to the function argument to be called with the argument passed to argument when a buffer becomes available.
The interface passed to function can be a routine that calls allocb or it can be implemented to perform something else.
NOTES
Even when the bufcall interface calls the interface passed to the function argument, the allocb interface can still fail if another module
or device driver allocated the memory before the interface in function was able to call allocb.
RETURN VALUES
Upon successful completion, the bufcall interface returns a bufcall id that you can use in a call to the unbufcall interface to cancel the
request. If the bufcall scheduling fails (that is, a buffer is not available), the interface passed to function is never called and bufcall
returns the value zero(0).
SEE ALSO
Kernel Routines: allocb(9r), esballoc(9r), testb(9r)
Programmer's Guide: STREAMS
bufcall(9r)
When i run dmesg, I get the following message which clearly indicates that the file system is full. Please let me know what does (1 block extent) means in the following error message?
msgcnt 1 vxfs : mesg 001: vx_nospace - /dev/vg00/lvol4 file system full (1 block extent)
Thanks (6 Replies)
It is customary to use structs in c code. but it is suprising to obtain different results. Sometimes a pointer is returned. But a failure would appear at other attempts.
e.g.
struct _site {
int type;
char A;
char B;
.
.
... (12 Replies)
If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it:
(1) one is to pass a pointer-to-pointer parameter, like:
int my_malloc(int size, char **pmem)
{
*pmem=(char *)malloc(size);
if(*pmem==NULL)... (11 Replies)
Hi All,
I got a problem in executing block.sh in w.sh. In particular, I got some files as
w.sh, block.sh , blackip.db , b.txt in a chain process as below:
w.sh --call --> block.sh -->blackip.db--->b.txt <--iptables
Ok, here are code
w.sh
block.sh
blackip.db is a file of ip... (2 Replies)