<br><br><div class="gmail_quote">On Fri, May 4, 2012 at 10:55 AM, 夏业添 <span dir="ltr"><<a href="mailto:summerxyt@gmail.com" target="_blank">summerxyt@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi rohan,<br>
<br>
I google fanotify and find it's a notification mechanism. My<br>
understanding is that fanotify can know fd being open, close, read,<br>
write, but transfer data between user space and kernel is out of its<br>
ability. If I'm wrong please tell me.<br>
<br>
The only reason I choose netlink to send data to user space is to<br>
notify user space process there is data, and avoid user space process<br>
do some polling job to check if there is data in kernel. Does fanotify<br>
or other method can do such thing?<br>
<br>
Thanks a lot!<br>
<br>
2012/5/4 rohan puri <<a href="mailto:rohan.puri15@gmail.com">rohan.puri15@gmail.com</a>>:<br>
<div class="HOEnZb"><div class="h5">><br>
> Hi,<br>
> To send data from kernel space and user-space see kernel's notification<br>
> mechanism like fanotify which works on by creating an anonymous fd in the<br>
> user-space process's context which then might perform normal read() and<br>
> write() call to receive and send data to kernel.<br>
><br>
> - Rohan<br>
</div></div></blockquote></div><br><div>To notify itself requires some data transfer. You can easily implement your own mechanism similar to fanotify which would contain you_fops (file operations) from which you could transfer data. Yes, user process needs to do polling to check whether data is available on the fd or not.</div>
<div><br></div><div>- Rohan</div>