Re: Select with device and stdin not working

From: M. Tavasti (tawz@nic.fi)
Date: Wed Jul 25 2001 - 08:35:05 EST


Ketil Froyn <ketil@froyn.com> writes:

> > while(1) {
> > FD_ZERO(&rfds);
> > FD_SET(fd,&rfds);
> > FD_SET(fileno(stdin),&rfds);
> > if( select(fd+1, &rfds, NULL, NULL, NULL ) > 0) {
(Lines removed)
> > }
>
> It looks like you are sending the original fd_set to select. Remember that
> it is modified in place.

But one would at least expect FD_ZERO() to really clean up rfds, and
after it FD_SET() is used again, for every call of select(). And this
code works fine in 2.0 kernels, and also with 2.2 and 2.4 if I'm using
named pipe and stdin. Therefore I have strong belief problem is not
usage of select() but something else.

-- 
M. Tavasti /  tawz@nic.fi  /   +358-40-5078254
-
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/



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:22 EST