I am looking at libsysfs to simplify some code that walks /sys manually.
I would like to have an easy way to list device children such as network
interfaces or block objects. For instance, in
/sys/bus/pci/devices/0000:0b:02.0 (my Wireless interface), I have
net:eth1 pointing to the /sys/class/net/eth1. Similarly, my IDE PCI
device contains host0/target0:0:0/0:0:0:0/block:sda which points to
/sys/class/block/sda. It offers an easy way to convert physical devices
from/to logical objects. Is there an easy to list such children? Device
attributes don't seem to contain these, and the children list isn't
populated from what I see.
PS: Note that, on some older kernel (2.6.30), /sys/class/foo/bar points
to /sys/bus/pci/devices/xxxx:yy:zz.t/foo/bar instead of having
/sys/bus/pci/devices/xxxx:yy:zz.t/foo:far point to it. Having a portable
way to support both foo/bar and foo:bar children would be nice.