Bug 27731

Summary: Incorrect example code in dev handbook causes FreeBSD to panic.
Product: Documentation Reporter: debolaz <debolaz>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description debolaz 2001-05-29 12:20:01 UTC
In section 18.2 of the FreeBSD Developers Handbook, an example code for a generic device is shown. This code is invalid.

-->
DECLARE_MODULE(skeleton, skel_loader, SI_SUB_KLD, SI_ORDER_ANY);
<--

Should be replaced with

-->
static moduledata_t linux_elf_mod = {
        "linuxelf",
        linux_elf_modevent,
        0
};

DECLARE_MODULE(skeleton, skel_loader, SI_SUB_KLD, SI_ORDER_ANY);
<--

Fix: 

The line

-->
DECLARE_MODULE(skeleton, skel_loader, SI_SUB_KLD, SI_ORDER_ANY);
<--

Should be replaced with

-->
static moduledata_t skeleton_mod = {
	"skeleton",
	skel_loader,
	0
};

DECLARE_MODULE(skeleton, skeleton_mod, SI_SUB_KLD, SI_ORDER_ANY);
<--
How-To-Repeat: Just the code in 18.2 and try it to see the effect. :)
Comment 1 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2001-08-03 20:04:32 UTC
State Changed
From-To: open->closed

This apparantly has been committed. 

Close as per originator's request.