Date: Tue, 29 Jul 2014 19:44:49 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-doc@FreeBSD.org Subject: [Bug 192250] New: module(9) and its corresponding manpages don't document that evhand (the load/unload/etc handler) can be NULL Message-ID: <bug-192250-9@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192250 Bug ID: 192250 Summary: module(9) and its corresponding manpages don't document that evhand (the load/unload/etc handler) can be NULL Product: Documentation Version: Latest Hardware: Any OS: Any Status: Needs Triage Severity: Affects Some People Priority: --- Component: Documentation Assignee: freebsd-doc@FreeBSD.org Reporter: yaneurabeya@gmail.com The structure for a kernel module is like so: 52 /* 53 * Struct for registering modules statically via SYSINIT. 54 */ 55 typedef struct moduledata { 56 const char *name; /* module name */ 57 modeventhand_t evhand; /* event handler */ 58 void *priv; /* extra data */ 59 } moduledata_t; The documentation doesn't note that evhand can be NULL though (and if it's NULL then modevent_nop will be used in lieu of evhand): $ grep -r evhand /sys/kern/ /sys/kern/kern_module.c: " %d\n", data->name, (void *)data->evhand, data->priv, /sys/kern/kern_module.c: newmod->handler = data->evhand ? data->evhand : modevent_nop; $ I looked at the examples in /usr/share/examples/kld and they didn't provide an example that did this either. -- You are receiving this mail because: You are the assignee for the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-192250-9>