Re: [RFC] User Guide for Sysfs and libudev
From: Kay Sievers <hidden>
Date: 2010-05-25 04:43:48
Also in:
lkml
On Mon, May 24, 2010 at 20:08, Alan Ott [off-list ref] wrote:
Several weeks ago I had need of libudev, and was unable to find very much documentation for it on the web. I have created a guide on how to use libudev, which also provides some background information on /dev, Sysfs, and why this kind of thing is needed. Please check it out and provide comments, as I'm sure there are things which I have gotten wrong or omitted. The guide can be found here: http://www.signal11.us/oss/udev/
Enumeration and monitoring should be in one example, I guess -- that's what people are supposed to do today. Before starting to enumerate, software should subscribe to events. This makes the handle coldplug/hotplug properly, makes it handle duplicate events properly, and all other sorts of cases, which software should handle today. Also "change" is not necessarily a "property" change, it can be any event, that a device has changed its state, it will only in a few cases be visible in /sys. The most prominent example is "media changed" event for SCSI devices, and we forward them to the block device. There will never change anything in /sys before or after the event. Kay