kobject-uevent

Kay Sievers kay.sievers at vrfy.org
Mon Jan 10 08:50:37 PST 2005


On Mon, 2005-01-10 at 17:11 +0100, Ikke wrote:
> since Linux kernel 2.6.10, there's a new concept in the vanilla code
> (similar to the patches by RML, Kay Sievers,...) called
> kobject-uevent('s), which allow the kernel to send events to userspace
> through a netlink socket.
> 
> After a little discussion on the dbus at fdo list (started by some stupid
> proposal by me), Kay suggested to take this into HAL, so (as an example)
> polling /etc/mtab shouldn't be necessary anymore to find out mount
> events, the kernel messages could be used.
> 
> I'd like to hack this into HAL, and made a CVS checkout. Now there's a
> minor problem: I have no idea where to do this. The netlink socket has
> to be monitored all time ("while (0)"), but I cannot find any place in
> the HAL sources where this is appropriate (for now). I must confess I
> did not read all of it already, but well...

That's the magic of a event mainloop. :)

You may look at:
  hald/linux/osspec.c:207

as an example how to integrate it:
  ...
  channel = g_io_channel_unix_new (socketfd);
  g_io_add_watch (channel, G_IO_IN, hald_helper_data, NULL);
  ...

Kay

_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list