|
自做字符驱动,文件操作函数write:
static ssize_t
my_write(struct file *filp, const char *buff, size_t count, loff_t *off)
{
char mybuff[4000];
int c;
c = count;
memset(mybuff, 0, sizeof(mybuff));
copy_from_user(mybuff, buff, 100);
DBG("writting: %s, filp = %X, pos = %d, count = %d\n", mybuff, (unsigned int)filp, (unsigned int)*off, c);
return count;
}
无论写入什么内容,count 总是为0,为什么会这样? |
|