请教copy_to_user的用法
我接着"请教设备驱动程序"问:char *words="aaabbbccc";
ssize_t scull_read(struct file *filp, char *buf, size_t count,
loff_t *f_pos)
{
printk("read %s\n",words);
copy_to_user(buf,words,count);
return 0;
}
这里 copy_to_user 不知道咋用
copy_to_user(buf,words,count);是我想当然的写的
编译通过后
#insmod chard.o
chard.o: unresolved symbol copy_to_user
请指教 u should include <asm/uaccess.h>
read LDD2 for detail. i bet the book has this. 谢谢
原来我没有 include make sure u read LDD2 Page 78-79 carefully. 我还没这本书呢 there is an e version online for freely download from its publisher site. i think is oriley..
页:
[1]