From owner-freebsd-doc@FreeBSD.ORG Tue Jul 29 19:44:49 2014 Return-Path: Delivered-To: freebsd-doc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F1C9ABB for ; Tue, 29 Jul 2014 19:44:49 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CEA62B6B for ; Tue, 29 Jul 2014 19:44:49 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s6TJinLf077276 for ; Tue, 29 Jul 2014 19:44:49 GMT (envelope-from bugzilla-noreply@freebsd.org) 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 Date: Tue, 29 Jul 2014 19:44:49 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Documentation X-Bugzilla-Component: Documentation X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: yaneurabeya@gmail.com X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-doc@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 19:44:49 -0000 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.