driver copy_to_user
Hi...:)
Quoted 3 lines · Hemanth Kumar
Hi mulyadi,
? ? ? ? ?Sorry for sending the mail directly,
It's ok, but just to let you know..I am just average when dealing with kernel :)
Quoted 8 lines
ssize_tmy_read(struct file *file,char *buf,size_t count,loff_t *pos){ ? ? unsigned long res;
? ? void *k = (void *)&x;
? ? ? ? ?void *l = (void *)&x+1;
? ? ? ? ?void *j = (void *)&x+2;? ? ? ? ? ? ? ? ? ?
mutex_lock(&timer);
? ? ? ? ? ? ? ? ? ? ? ? ? ? res = ? ?copy_to_user(buf,k,sizeof(short));
hm, you say "read from user space", right? Then why "copy_to_user"? shouldn't it be "copy_from_user"?
Signature · 7 lines
regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com