17.7.3. sysfs
Sysfs is more restricted than procfs, as it does not take an arbitrary file_operations
:
./sysfs.sh echo $?
Outcome: the test passes:
0
Sources:
Vs procfs:
You basically can only do open
, close
, read
, write
, and lseek
on sysfs files.
It is similar to a seq_file file operation, except that write is also implemented.
TODO: what are those kobject
structs? Make a more complex example that shows what they can do.
Bibliography: