Hi,
struct kobj_attribute {
struct attribute attr;
ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr, char *buf);
ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count);
};
+55 (19) 988176559
I'm looking for some information about :
struct attribute attr;
ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr, char *buf);
ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count);
};
My function to handle the operation:
static ssize_t my_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count)
{
char *buffer;
buffer = (char*) kcalloc(count, sizeof(char), GFP_KERNEL);
if (count == 13) {
if (buffer) {
copy_from_user(buffer, buf, count);
printk("A %s",buffer);
if (0) {
if (strcmp(buffer, eudyptula_id) == 0)
return count;
printk("erro na strcmp\n");
}
else
printk("erro na copia\n");
}
}
return -EINVAL;
}
So, this const char *buf, where ti come from ? Kernel space
--
Lucas Tanure +55 (19) 988176559
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies