On 4/17/20 1:52 AM, Getz, Robin wrote:
I was looking at trying to make some userspace code a little more robust, and needed to understand the potential size of things behind sysfs. For example, I would think that would be a "max length of the string that represents the device name". But I couldn't find anything... I understand that some of the names are encoded in the sysfs file name, and therefor are NAME_MAX worse case, but things like device name have no such limit. It's not practical/useful that they are PAGE_SIZE (does anyone need a 4k name?) but right now - I think that might be the limit (unless I'm missing something).
Yes, PAGE_SIZE. Although that is an implementation detail on the kernel side, best is to assume any size is possible.
- Lars