From nobody@FreeBSD.org  Tue Jul 29 14:32:22 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C9861106568A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 29 Jul 2008 14:32:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 9DC638FC25
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 29 Jul 2008 14:32:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m6TEWMQJ006314
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 29 Jul 2008 14:32:22 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m6TEWMD2006313;
	Tue, 29 Jul 2008 14:32:22 GMT
	(envelope-from nobody)
Message-Id: <200807291432.m6TEWMD2006313@www.freebsd.org>
Date: Tue, 29 Jul 2008 14:32:22 GMT
From: Petr Salinger <Petr.Salinger@seznam.cz>
To: freebsd-gnats-submit@FreeBSD.org
Subject: POLL_ERR and POLL_HUP are defined identically
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         126076
>Category:       kern
>Synopsis:       [headers] POLL_ERR and POLL_HUP are defined identically
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jilles
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 29 14:40:00 UTC 2008
>Closed-Date:    Sun Dec 05 12:19:35 UTC 2010
>Last-Modified:  Sun Dec 05 12:19:35 UTC 2010
>Originator:     Petr Salinger
>Release:        7.0
>Organization:
>Environment:
>Description:
POLL_ERR and POLL_HUP  are defined in <sys/signal.h>, they both have the same value (4). I doubt whether it is deliberate or not. It looks more like a typo.
The same value causes problems for "case POLL_ERR:", "case POLL_HUP:" handling.

It doesn't look like kernel generates these codes so far.

>How-To-Repeat:

>Fix:
#define POLL_HUP      6       /* Device disconnected                  */


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: brueffer 
State-Changed-When: Wed Oct 21 16:03:51 CEST 2009 
State-Changed-Why:  
According to kib this is intentional. POLL_ERR is not implemented, 
so it is simply mapped to POLL_HUP for now. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=126076 

From: Jilles Tjoelker <jilles@stack.nl>
To: bug-followup@FreeBSD.org, Petr.Salinger@seznam.cz
Cc:  
Subject: Re: kern/126076: [headers] POLL_ERR and POLL_HUP are defined
	identically
Date: Sat, 7 Nov 2009 16:34:45 +0100

 To be honest, I do not know why the POLL_* constants are defined at all.
 The kernel never generates SIGPOLL, and it is an obsolescent feature in
 POSIX. Their main effect seems that someone can use POLL_IN instead of
 POLLIN and have a hard time debugging.
 
 How are you using these constants? :)
 
 -- 
 Jilles Tjoelker

From: Petr Salinger <Petr.Salinger@seznam.cz>
To: Jilles Tjoelker <jilles@stack.nl>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/126076: [headers] POLL_ERR and POLL_HUP are defined
 identically
Date: Sat, 7 Nov 2009 20:15:29 +0100 (CET)

 > To be honest, I do not know why the POLL_* constants are defined at all.
 > The kernel never generates SIGPOLL, and it is an obsolescent feature in
 > POSIX. Their main effect seems that someone can use POLL_IN instead of
 > POLLIN and have a hard time debugging.
 >
 > How are you using these constants? :)
 
 Some code uses them, i.e. boost
 https://svn.boost.org/trac/boost/browser/trunk/boost/test/impl/execution_monitor.ipp
 
 It would be much better to reserve new value for either
 POLL_ERR or POLL_HUP just now or drop all POLL_* and SIGPOLL constants.
 
 IMHO, the current situation does not conform to POSIX-2008, see
 http://www.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
 http://www.opengroup.org/onlinepubs/9699919799/basedefs/poll.h.html
 
 Petr
State-Changed-From-To: closed->open 
State-Changed-By: jilles 
State-Changed-When: Fri Nov 5 16:48:03 UTC 2010 
State-Changed-Why:  
I think this is in fact a problem and can safely be fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=126076 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/126076: commit references a PR
Date: Fri, 12 Nov 2010 15:30:54 +0000 (UTC)

 Author: jilles
 Date: Fri Nov 12 15:30:49 2010
 New Revision: 215183
 URL: http://svn.freebsd.org/changeset/base/215183
 
 Log:
   Make POLL_ERR and POLL_HUP different.
   
   The kernel currently does not generate any of the POLL_* constants, but
   some applications use them and break if they are not all distinct.
   
   PR:		kern/126076
   MFC after:	1 week
 
 Modified:
   head/sys/sys/signal.h
 
 Modified: head/sys/sys/signal.h
 ==============================================================================
 --- head/sys/sys/signal.h	Fri Nov 12 15:20:10 2010	(r215182)
 +++ head/sys/sys/signal.h	Fri Nov 12 15:30:49 2010	(r215183)
 @@ -284,7 +284,7 @@ typedef	struct __siginfo {
  #define POLL_MSG	3	/* Input message available		*/
  #define POLL_ERR	4	/* I/O Error				*/
  #define POLL_PRI	5	/* High priority input available	*/
 -#define POLL_HUP	4	/* Device disconnected			*/
 +#define POLL_HUP	6	/* Device disconnected			*/
  
  #endif
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: jilles 
State-Changed-When: Fri Nov 12 15:42:33 UTC 2010 
State-Changed-Why:  
Fixed in 9-current. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=126076 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/126076: commit references a PR
Date: Sat, 20 Nov 2010 16:46:21 +0000 (UTC)

 Author: jilles
 Date: Sat Nov 20 16:46:16 2010
 New Revision: 215572
 URL: http://svn.freebsd.org/changeset/base/215572
 
 Log:
   MFC r215183: Make POLL_ERR and POLL_HUP different.
   
   The kernel currently does not generate any of the POLL_* constants, but
   some applications use them and break if they are not all distinct.
   
   PR:		kern/126076
 
 Modified:
   stable/8/sys/sys/signal.h
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
   stable/8/sys/dev/xen/xenpci/   (props changed)
 
 Modified: stable/8/sys/sys/signal.h
 ==============================================================================
 --- stable/8/sys/sys/signal.h	Sat Nov 20 16:42:19 2010	(r215571)
 +++ stable/8/sys/sys/signal.h	Sat Nov 20 16:46:16 2010	(r215572)
 @@ -283,7 +283,7 @@ typedef	struct __siginfo {
  #define POLL_MSG	3	/* Input message available		*/
  #define POLL_ERR	4	/* I/O Error				*/
  #define POLL_PRI	5	/* High priority input available	*/
 -#define POLL_HUP	4	/* Device disconnected			*/
 +#define POLL_HUP	6	/* Device disconnected			*/
  
  #endif
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: jilles 
State-Changed-When: Sun Dec 5 12:18:57 UTC 2010 
State-Changed-Why:  
Fixed in 8.x and 9.x, no fix planned for 7.x. 


Responsible-Changed-From-To: freebsd-bugs->jilles 
Responsible-Changed-By: jilles 
Responsible-Changed-When: Sun Dec 5 12:18:57 UTC 2010 
Responsible-Changed-Why:  
Track. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=126076 
>Unformatted:
