What is the difference between sysfs_create_file () and sysfs_create_group ()?

Prototypes of two functions:

int sysfs_create_group(struct kobject *kobj, const struct attribute_group *grp) int sysfs_create_file(struct kobject * kobj, const struct attribute * attr) 

It seems to me that these two functions will create attributes in the kobj->name directory in sysfs . The only difference I can find is group func can create an attribute group at a time since the file has only one attribute. Are there any other hobbies? Or my understanding of the wrong functions?

+6
source share
1 answer

Yes, a group is just a helper shell that makes managing multiple attributes easier. You can read about them in section 9 of this pdf .

+3
source

Source: https://habr.com/ru/post/928096/


All Articles