[PATCH 04/11] Task watchers: Make process events configurable as a module

Matt Helsley
2006-06-14T00:01:49Z

This patch changes process events so that it may be configured as a module.

Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
--

drivers/connector/Kconfig | 8 ++++----
drivers/connector/cn_proc.c | 18 ++++++++++++++++++
2 files changed, 22 insertions(+), 4 deletions(-)

Index: linux-2.6.17-rc6-mm2/drivers/connector/Kconfig
===================================================================
--- linux-2.6.17-rc6-mm2.orig/drivers/connector/Kconfig
+++ linux-2.6.17-rc6-mm2/drivers/connector/Kconfig
@@ -9,13 +9,13 @@ config CONNECTOR

Connector support can also be built as a module. If so, the module
will be called cn.ko.

config PROC_EVENTS
- boolean "Report process events to userspace"
- depends on CONNECTOR=y
- default y
- ---help---
+ tristate "Report process events to userspace"
+ default m
+ depends on CONNECTOR
+ help
Provide a connector that reports process events to userspace. Send
events such as fork, exec, id change (uid, gid, suid, etc), and exit.

endmenu
Index: linux-2.6.17-rc6-mm2/drivers/connector/cn_proc.c
===================================================================
--- linux-2.6.17-rc6-mm2.orig/drivers/connector/cn_proc.c
+++ linux-2.6.17-rc6-mm2/drivers/connector/cn_proc.c
@@ -224,6 +224,24 @@ static int __init cn_proc_init(void)
cn_del_callback(&cn_proc_event_id);
out:
return err;
}

+static void cn_proc_fini(void)
+{
+ int err;
+
+ err = unregister_task_watcher(&cn_proc_nb);
+ if (err != 0)
+ printk(KERN_WARNING
+ "cn_proc failed to unregister its task notify block\n");
+
+ cn_del_callback(&cn_proc_event_id);
+}
+
module_init(cn_proc_init);
+module_exit(cn_proc_fini);
+
+MODULE_AUTHOR("Matt Helsley <matthltc@us.ibm.com>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Notification of process events.");
+MODULE_VERSION("2:1.0");

--