In the file_operations struct, it is a pointer to another function that your module/code should implement. The file_operations struct, like many others in the kernel, contains a generic set of functions that the kernel expect your code will implement.<br>
<div></div><div><br></div><div>In the proc fs for example, mounts_poll (<a href="http://lxr.linux.no/linux+v2.6.38.8/fs/proc/base.c#L639">http://lxr.linux.no/linux+v2.6.38.8/fs/proc/base.c#L639</a>) is an implementation of the poll function that is later associated with the pointer of the file_operations structure at <a href="http://lxr.linux.no/linux+v2.6.38.8/fs/proc/base.c#L661">http://lxr.linux.no/linux+v2.6.38.8/fs/proc/base.c#L661</a></div>
<div><br></div><div>Take a look at the LDD (<a href="http://lwn.net/Kernel/LDD3/">http://lwn.net/Kernel/LDD3/</a>) to learn how a driver implementation should use these kind of functions to understand it better.</div><div>
<br></div><div>-- <br>Henrique Rodrigues<br><div><a href="http://www.dcc.ufmg.br/~hsr" target="_blank">http://www.dcc.ufmg.br/~hsr</a></div></div><div><br><div class="gmail_quote">On Fri, Jan 11, 2013 at 12:14 AM, horseriver <span dir="ltr"><<a href="mailto:horserivers@gmail.com" target="_blank">horserivers@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:<br>
<br>
for a socket file point , what will this function do ?<br>
<br>
file->f_op->poll(); ///poll is declared in the file-operations struct .<br>
<br>
but I do not find this function's definition .<br>
<br>
Is there some advice?<br>
<br>
thanks!<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div><br><br clear="all"><div><br></div><br>
</div>