From nobody@FreeBSD.org  Tue May 29 04:11:25 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 511B337B422
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 29 May 2001 04:11:25 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f4TBBP066365;
	Tue, 29 May 2001 04:11:25 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200105291111.f4TBBP066365@freefall.freebsd.org>
Date: Tue, 29 May 2001 04:11:25 -0700 (PDT)
From: debolaz@debolaz.com
To: freebsd-gnats-submit@FreeBSD.org
Subject: Incorrect example code in dev handbook causes FreeBSD to panic.
X-Send-Pr-Version: www-1.0

>Number:         27731
>Category:       docs
>Synopsis:       Incorrect example code in dev handbook causes FreeBSD to panic.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 29 04:20:01 PDT 2001
>Closed-Date:    Fri Aug 3 12:04:32 PDT 2001
>Last-Modified:  Fri Aug 03 12:05:14 PDT 2001
>Originator:     Anders Nor Berle
>Release:        FreeBSD 4.3
>Organization:
>Environment:
>Description:
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);
<--
>How-To-Repeat:
Just the code in 18.2 and try it to see the effect. :)
>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);
<--

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: asmodai 
State-Changed-When: Fri Aug 3 12:04:32 PDT 2001 
State-Changed-Why:  
This apparantly has been committed. 

Close as per originator's request. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27731 
>Unformatted:
