* for a socket file , what does "file->f_op->poll()" do ?
@ 2013-01-11 8:14 horseriver
2013-01-11 20:02 ` Henrique Rodrigues
0 siblings, 1 reply; 2+ messages in thread
From: horseriver @ 2013-01-11 8:14 UTC (permalink / raw)
To: kernelnewbies
hi:
for a socket file point , what will this function do ?
file->f_op->poll(); ///poll is declared in the file-operations struct .
but I do not find this function's definition .
Is there some advice?
thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
* for a socket file , what does "file->f_op->poll()" do ?
2013-01-11 8:14 for a socket file , what does "file->f_op->poll()" do ? horseriver
@ 2013-01-11 20:02 ` Henrique Rodrigues
0 siblings, 0 replies; 2+ messages in thread
From: Henrique Rodrigues @ 2013-01-11 20:02 UTC (permalink / raw)
To: kernelnewbies
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.
In the proc fs for example, mounts_poll (
http://lxr.linux.no/linux+v2.6.38.8/fs/proc/base.c#L639) is an
implementation of the poll function that is later associated with the
pointer of the file_operations structure at
http://lxr.linux.no/linux+v2.6.38.8/fs/proc/base.c#L661
Take a look at the LDD (http://lwn.net/Kernel/LDD3/) to learn how a driver
implementation should use these kind of functions to understand it better.
--
Henrique Rodrigues
http://www.dcc.ufmg.br/~hsr
On Fri, Jan 11, 2013 at 12:14 AM, horseriver <horserivers@gmail.com> wrote:
> hi:
>
> for a socket file point , what will this function do ?
>
> file->f_op->poll(); ///poll is declared in the file-operations
> struct .
>
> but I do not find this function's definition .
>
> Is there some advice?
>
> thanks!
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130111/e38d6572/attachment.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-11 20:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-11 8:14 for a socket file , what does "file->f_op->poll()" do ? horseriver
2013-01-11 20:02 ` Henrique Rodrigues
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).