Filesize in sysfs, debugfs, ...

Stephan Müller fruktopus at gmail.com
Fri Jun 26 04:00:03 EDT 2015


Hi all, 

I have a question, what is the policy on file size in sysfs and especially in debugfs?

Many (but not all) of the files report a size of 0. Recently I diffed against a file in sysfs. The files were identical, despite the fact one reported size 0. I got the unpleasant result

diff -as file1 file2                (treat both as text, report identical files)
Files file1 and file2 are identical

diff -asq file1 file2               (treat both as text, report just yes/no)
Files file1 and file2 differ

In brief mode diff looks first for file sizes and stops if they don't match. 

For files which don't differ in size (e.q, exposing a bool) it would be easy to set the proper size for others it's not.


   Thank you,
   Stephan



More information about the Kernelnewbies mailing list