I (and fellow classmates) cannot figure out the following question:
"Consider the following FOPS read() method:
ssize_t my_chrdrv_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
{
char readBuf[] = "ABCD";
copy_to_user(buf, readBuf, len);
...
}
The method is called with the parameter count=2. What should the size of 'len' be?"
We're not sure whether the answer is 2, because count is 2 - or if the answer is 5, because 'ABCD + /0' = 5.
Are we missing something here?