Re: libudev, a question about the enumerate API.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/07/2011 10:27 AM, Kay Sievers wrote:
The usual enumeration in udev never uses the device tree in
/sys/devices/, only the subsystem lists /sys/{class,bus}/. We could
have something to enumerate all child devices of a given device. It's
not simple, but could be made working.

Hi Kay,

The documentation in Documentation/sysfs-rules.txt seems to warn against using /sys/class and sys/bus:

- devices are only "devices"
  There is no such thing like class-, bus-, physical devices,
  interfaces, and such that you can rely on in userspace. Everything is
  just simply a "device". Class-, bus-, physical, ... types are just
  kernel implementation details which should not be expected by
  applications that look for devices in sysfs.

...
      - all elements of a devpath must be real directories. Symlinks
        pointing to /sys/devices must always be resolved to their real
        target and the target path must be used to access the device.
        That way the devpath to the device matches the devpath of the
        kernel used at event time.
      - using or exposing symlink values as elements in a devpath string
        is a bug in the application

...

- accessing attributes reached by a symlink pointing to another device,
        like the "device"-link, is a bug in the application

...

- Hierarchy in a single device tree
  There is only one valid place in sysfs where hierarchy can be examined
  and this is below: /sys/devices.

and more...

I figured that this document was probably out of date, since even libudev uses /sys/class. What's your take on this document?

Alan.


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux