The two functions' prototypes:
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 both create attributes under the kobj->name
directory in sysfs
. The only difference I can find is, the group func can create a group of attributes in one time as the file func only one attribute.
So are there other deferences? Or is my understanding of the functions wrong?
Yes, the group is just a helper wrapper that makes it easier to manage multiple attributes. You can read about them in section 9 of this pdf.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With