libsysfs device children

Brice Goglin <[email protected]>
Newsgroups gmane.linux.tools.diag.devel
Message-ID <[email protected]>
Hello,

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.

thanks
Brice Goglin

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.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.