Thread (2 messages) 2 messages, 2 authors, 2013-12-05

Should I pass user-space buffer pointer to read() of struct file implemented by `filp_open()`?

From: 乃宏周 <hidden>
Date: 2013-11-27 13:57:19

In module code:

*unsigned char buf[20];*

*struct file *device;*

*device = filp_open(...);*

*device->f_op->read(device,buf,20,&device->f_pos);*

In signature(interface) of *read()* of *struct file*, *buf* should came
from user-space. I fed my buffer, and I get correct data from that, Is that
correct? Shouldn't I provide a user-space buffer to that ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20131127/8f7dbebc/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help