_No_. This is how /proc/PID/stat, /proc/net/dev and others currently
look like, and it means that user level code will have to be adapted
whenever an item is added to the format. That is bad bad bad.
We need a tagged format, where each item is unambiguously labeled. Yes
this makes it a bit more verbose, but parsing it is just as trivial.
With this format
device=eth0;ip_address=192.168.201.116;netmask=255.255.255.0;
(note the trailing semicolon!) you can say "give me the netmask of
eth0" as
fgrep "device=eth0;" /proc/... | sed -n 's,.*;netmask=\(.*\);.*,\1,p'
in a simple, natural (to Un*xheads) way and this won't break if
sometimes the /proc entry suddenly becomes
device=eth0;mac_address=00:40:33:B0:1C:9F;ip_address=192.168.201.116;netmask=255.255.255.0;
in the next kernel version.
Olaf
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/