Re: [PATCH]: Event-0.78 for IRIX 6.5.x (take 2)

[email protected] (Joshua N Pritikin)
Newsgroups perl.loop
Message-ID <[email protected]>
On Thu, Jul 06, 2000 at 10:19:02AM +0200, [email protected] wrote:
> Although my previous patch works, it doesn't solve the real problem.
> I have tested a bit more and found out that you cannot set POLLHUP in the
> events field on IRIX. This will cause an immediate return by poll which
> causes the excessive CPU usage.
> 
> Attached patch eliminates the POLLHUP bit in the events field.
> 
> The IRIX manual page about POLLHUP:
> 
>      POLLHUP        A hangup has occurred on the stream.  This event and
>                     POLLOUT are mutually exclusive; a stream can never be
>                     writable if a hangup has occurred.  However, this event
>                     and POLLIN, POLLRDNORM, POLLRDBAND, or POLLPRI are not
>                     mutually exclusive.  This flag is only valid in the
>                     revents bitmask; it is not used in the events field.
> 
> I also checked the Solaris 2.6 and Linux manual pages and they both state
> the the POLLHUP bit flag is only valid in the revents field.
> It is probably harmless on those platforms to have it in the events field,
> but it obviously isn't on IRIX.
> 
> 	Robert
> 
> 
> -- 
> Robert H. de Vries	mailto:[email protected]
> PO/SIM
> Fokker Space B.V.	http://www.fokkerspace.nl
> tel: (+31)71-5245464	fax: (+31)71-5245498

> --- Event-0.78/c/unix.c.orig	Thu Jul  6 09:02:31 2000
> +++ Event-0.78/c/unix.c	Thu Jul  6 10:10:19 2000
> @@ -89,7 +89,7 @@
>  	    ev->xref = -1;
>  	    assert(fd >= 0); {
>  		int bits=0;
> -		if (ev->poll & PE_R) bits |= (POLLIN | POLLRDNORM | POLLHUP);
> +		if (ev->poll & PE_R) bits |= (POLLIN | POLLRDNORM);
>  		if (ev->poll & PE_W) bits |= (POLLOUT |POLLWRNORM |POLLWRBAND);
>  		if (ev->poll & PE_E) bits |= (POLLRDBAND | POLLPRI);
>  		assert(bits); {

Applied.

Thanks!

-- 
"Never ascribe to malice that which can be explained by stupidity."
                           via, but not speaking for Deutsche Bank
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.