LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   sysfs read access on attribute -> output buffer (https://www.linuxquestions.org/questions/programming-9/sysfs-read-access-on-attribute-output-buffer-740021/)

donhuansohn 07-14-2009 11:59 AM

sysfs read access on attribute -> output buffer
 
hallo,

i created 3 attributes for a device:


static char *ubergabeName = "omg";

...

...
.....


DEVICE_ATTR(name,0644,NULL,NULL);
DEVICE_ATTR(pid,0644,NULL,NULL);
DEVICE_ATTR(pgdir,0644,NULL,NULL);
device_create_file(husoDevice,&dev_attr_name);
device_create_file(husoDevice,&dev_attr_pid);
device_create_file(husoDevice,&dev_attr_pgdir);


now, if in usermode, a reading access on "name" is noticed, the value of ubergabeName (== omg) must be copied to the output puffer.

i think it has something to do with sysfs_ops but i dont know how to write that,

if anyone can help, could you please write a small sourcecode?

thanks


All times are GMT -5. The time now is 06:48 PM.