> > On Tue, 2002-11-05 at 20:23, Richard B. Johnson wrote:
> > > Hey, look. I can only warn. You do what you want. As far as I'm
> > > concerned support stopped at Linux 2.4.19 when poll got trashed.
> > > Nobody can use 2.4.19 or probably anything later unless they have
> > > powerful CPUs that can spin with 1000 SIGPOLL signals per second.
>
> Enable SIGPOLL on STDIN_FILENO and connect from the network as previously
> shown. You will get 100% CPU time on the task with this enabled.
Can you please stop harping about this? You have written essentially
the same mail over and over again without adding any new information.
First of all, your problem has nothing to do with networking, the same
thing will happen if you run your program from within screen, so it
seems to have more to do with ptys and how both screen and telnetd
sets them up.
Second, it seems that your program does exactly what is expected. Try
applying this patch to your example program and see what happens:
diff -u ./polltest.c.orig ./polltest.c
--- ./polltest.c.orig Wed Nov 6 15:36:09 2002
+++ ./polltest.c Wed Nov 6 15:35:54 2002
@@ -47,7 +47,7 @@
{
struct pollfd pf;
pf.fd = STDIN_FILENO;
- pf.events = POLLIN;
+ pf.events = POLLIN | POLLOUT | POLLERR;
pf.revents = 0;
(void)poll(&pf, 1, 0);
if(pf.revents & POLLIN)
Each time you print the "POLLOUT = 3 POLLERR = 0" message, you fill up
the write buffer, and each time the write queue empties you will get
another SIGIO. Now, this may not be what you want, but it seems to be
entirely within specs.
If you remove the fprintf(stderr, "POLLOUT... from your signal handler
you will not see the same effect as you are complaining about. Your
measurements are interfering with what you are trying to measure.
/Christer
-- "Just how much can I get away with and still go to heaven?"Freelance consultant specializing in device driver programming for Linux Christer Weinigel <christer@weinigel.se> http://www.weinigel.se - 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/