 |
Index for Section 9 |
|
 |
Alphabetical listing for M |
|
 |
Bottom of page |
|
MGETHDR(9r)
NAME
MGETHDR - Network: Allocates an mbuf structure and initializes it to
contain a packet header and internal data
SYNOPSIS
#include <sys/mbuf.h>
MGETHDR(
struct mbuf *mbuf_p,
int how,
int type );
ARGUMENTS
mbuf_p
Specifies a pointer to the mbuf structure for which you want to
allocate memory.
how Specifies how you want MGETHDR() to allocate the memory. You can pass
one of the following constants defined in <mbuf.h>:
M_WAIT Allocates memory from the virtual memory subsystem if there is
not enough memory in the preallocated pool. This constant
signifies that the internal interface that allocates the memory
can block.
M_DONTWAIT
Does not allocate memory from the virtual memory subsystem if
there is not enough memory in the preallocated pool. This
constant signifies that the internal interface that allocates
the memory cannot block.
type
Specifies the type of memory buffer. The <mbuf.h> file defines the
possible memory buffer constants that you can pass. The MGETHDR()
routine uses this value to initialize the mh_type member of the mbuf
structure.
DESCRIPTION
The MGETHDR() routine calls an internal interface that allocates memory to
accommodate the specified mbuf structure pointer. If MGETHDR() successfully
allocates the memory, it initializes the following members to contain
internal data:
· mh_next
· mh_type
· mh_data
· mh_flags
Unlike the MGET() routine, MGETHDR() initializes the mh_flags member to
specify that a packet header is included.
If MGETHDR() cannot successfully allocate the memory, it calls an internal
interface to retry allocating the memory.
RETURN VALUES
None
FILES
<mbuf.h>
SEE ALSO
Routines: MGET(9r), MCLGET(9r), MCLGET2(9r)
Data Structures: mbuf(9s)
 |
Index for Section 9 |
|
 |
Alphabetical listing for M |
|
 |
Top of page |
|