diff options
author | Greg Kroah-Hartman <greg@kroah.com> | 2004-09-10 02:45:35 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <greg@kroah.com> | 2004-09-10 02:45:35 -0700 |
commit | 12025235884570ba7f02a6f427f973ac6be7ec54 (patch) | |
tree | bae3f75be04cf75951e53cf50b1a68388fd9c1c0 /init | |
parent | dd18ea08511c8f613d59230fad7e2dc2f6b44f75 (diff) | |
download | history-12025235884570ba7f02a6f427f973ac6be7ec54.tar.gz |
Kobject Userspace Event Notification
Implemetation of userspace events through a netlink socket. The kernel events
layer provides the functionality to raise an event from a given kobject
represented by its sysfs-path and a signal string to describe the type of
event.
Currently, kobject additions and removals are signalized to userspace by forking
the /sbin/hotplug helper. This patch moves this special case of userspace-event
out of the kobject core to the new kobject_uevent implementation. This makes it
possible to send all hotplug messages also through the new netlink transport.
Possible new users of the kernel userspace functionality are filesystem
mount events (block device claim/release) or simple device state transitions
(cpu overheating).
To send an event, the user needs to pass the kobject, a optional
sysfs-attribute and the signal string to the following function:
kobject_uevent(const char *signal,
struct kobject *kobj,
struct attribute *attr)
Example:
kobject_uevent("overheating", &cpu->kobj, NULL);
The message itself is sent over multicast netlink socket, which makes
it possible for userspace to listen with multiple applications for the same
messages.
Signed-off-by: Robert Love <rml@novell.com>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'init')
-rw-r--r-- | init/Kconfig | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig index 899a912b2b6c66..b2aca002acaa9b 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -195,6 +195,25 @@ config HOTPLUG agent" (/sbin/hotplug) to load modules and set up software needed to use devices as you hotplug them. +config KOBJECT_UEVENT + bool "Kernel Userspace Events" + depends on NET + default y + help + This option enables the kernel userspace event layer, which is a + simple mechanism for kernel-to-user communication over a netlink + socket. + The goal of the kernel userspace events layer is to provide a simple + and efficient events system, that notifies userspace about kobject + state changes. This will enable applications to just listen for + events instead of polling system devices and files. + Hotplug events (kobject addition and removal) are also available on + the netlink socket in addition to the execution of /sbin/hotplug if + CONFIG_HOTPLUG is enabled. + + Say Y, unless you are building a system requiring minimal memory + consumption. + config IKCONFIG bool "Kernel .config support" ---help--- |