If you have multiple values per file, why not make it a directory with
multiple files in it, each with one value per file.
If you care about speed, perhaps you can provide a ".array" virtual
file in such a (or each) directory, that when read returns all files
in the directory in "filename: value" format so that you avoid the
while (readdir()) { open(); close(); } overhead.
This would be much cleaner, think for example of how you would
otherwise _write_ individual entries in such an array.
If you really want to get overboard, provide a sysctl() like function
that can read the entries in driverfs in binary. Like the existing
sysctl() in linux, but with an added TYPE_INT, TYPE_STRING etc flag
for each value for consistency. It too should be able to read an
entire directory as an array.
Then, convert procfs to the same interface ;)
Mike.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/