Sample Header Ad - 728x90

Getting information from sysfs

7 votes
1 answer
12181 views
I'm creating a script for polling information about network interfaces. For this I get some data from /sysfs. Everything went fine until I wanted to clarify all possible states of an interface (Which are they btw? I'm aware for now only about up, down and unknown). I went through /usr/src/linux/Documentation/sysfs-rules.txt and found this: > Accessing /sys/class/net/eth0/device is a bug in the application Is there a reason for this? Could someone explain me if I'm doing something wrong by getting information from /sysfs? I don't iterate through all interfaces in /sysfs but get all network interfaces with getifaddrs(3). Perhaps there is another method to get iface status? Thanks.
Asked by UVV (3128 rep)
Aug 14, 2014, 08:29 AM
Last activity: Jun 3, 2024, 06:35 AM