Bug 24797

Summary: when using MALLOC_DEFINE sys/param.h and sys/kernel.h are needed
Product: Documentation Reporter: brandt <brandt>
Component: Books & ArticlesAssignee: Hartmut Brandt <harti>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description brandt 2001-02-02 13:30:00 UTC
It should be documented in malloc(9) that sys/param.h is needed to get
NULL defined and sys/kernel.h to get SYSINIT defined when one uses
MALLOC_DEFINE().

Fix: 

Add something like

.Fd #include <sys/param.h>
.Fd #inclued <sys/kernel.h>

just above the line

MALLOC_DEFINE(M_FOOBUF, "foobuffers", "Buffers to foo data into the ether");

in the man page.
How-To-Repeat: 
Try to compile this file:

# include <sys/types.h>
# include <sys/malloc.h>

MALLOC_DEFINE(M_FOOBUF, "foobuffers", "Buffers to foo data into the ether");

and see the compile errors.
Comment 1 nik freebsd_committer freebsd_triage 2001-02-09 19:03:53 UTC
Responsible Changed
From-To: freebsd-doc->phk

Poul, is this a doc bug, or an implementation bug?
Comment 2 Hartmut Brandt freebsd_committer freebsd_triage 2003-04-09 10:14:36 UTC
State Changed
From-To: open->closed

Man page changed to document the need of the two additional 
includes for MALLOC_DEFINE. 


Comment 3 Hartmut Brandt freebsd_committer freebsd_triage 2003-04-09 10:14:36 UTC
Responsible Changed
From-To: phk->harti

Man page changed to document the need of the two additional 
includes for MALLOC_DEFINE.