| Summary: | Incorrect example code in dev handbook causes FreeBSD to panic. | ||
|---|---|---|---|
| Product: | Documentation | Reporter: | debolaz <debolaz> |
| Component: | Books & Articles | Assignee: | freebsd-doc (Nobody) <doc> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Latest | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->closed This apparantly has been committed. Close as per originator's request. |
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. :)