lkml.org 
[lkml]   [2006]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linux poll() <sigh> again
On 11.05.2006 [17:04:46 -0400], linux-os (Dick Johnson) wrote:
>
> On Thu, 11 May 2006, Nishanth Aravamudan wrote:
>
> > On 11.05.2006 [10:25:29 -0400], linux-os (Dick Johnson) wrote:
> >>
> >>
> >> Hello,
> >>
> >> I'm trying to fix a long-standing bug which has a
> >> work-around that has been working for a year or
> >> so.
> >
> > <snip valiant efforts>
> >
> >> Here is relevent code:
> >>
> >> for(;;) {
> >> mem->pfd.fd = fd;
> >> mem->pfd.events = POLLIN|POLLERR|POLLHUP|POLLNVAL;
> >> mem->pfd.revents = 0x00;
> >
> > Hrm, in looking at the craziness that is sys_poll() for a bit, I think
> > it's the underlying f_ops that are responsible for not setting POLLHUP,
> > that is:
> >
> > if (file != NULL) {
> > mask = DEFAULT_POLLMASK;
> > if (file->f_op && file->f_op->poll)
> > mask = file->f_op->poll(file, *pwait);
> > mask &= fdp->events | POLLERR | POLLHUP;
> > fput_light(file, fput_needed);
> > }
> >
> > and file->f_op->poll(file, *pwait) is not setting POLLHUP on the
> > disconnect. What filesystem is this?
>
> I think that's the problem. A socket isn't a file-system and the
> code won't set either bits if it isn't. Perhaps, the kernel code
> needs to consider a socket as a virtual file of some kind? Surely
> one needs to use poll() on sockets, no?

Duh, I'm not reading well today -- for sockets, we do

file->f_op->poll() -> (socket_file_ops) sock_poll() -> sock->ops->poll()

So, now I need to know what kind of socket is this to go from there ...

Thanks,
Nish

--
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-11 23:18    [W:1.833 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site