From owner-svn-src-all@FreeBSD.ORG Sun Nov 21 13:35:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FB86106566B; Sun, 21 Nov 2010 13:35:33 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 3BA128FC13; Sun, 21 Nov 2010 13:35:33 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 3DF551DD644; Sun, 21 Nov 2010 14:35:32 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 248C417199; Sun, 21 Nov 2010 14:35:32 +0100 (CET) Date: Sun, 21 Nov 2010 14:35:32 +0100 From: Jilles Tjoelker To: Gavin Atkinson Message-ID: <20101121133531.GB17293@stack.nl> References: <201011201646.oAKGkGW7019085@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r215572 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 13:35:33 -0000 On Sun, Nov 21, 2010 at 12:42:24PM +0000, Gavin Atkinson wrote: > On Sat, 20 Nov 2010, Jilles Tjoelker wrote: > > 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. > Is this a good idea to merge to a stable branch? Presumably some of those > same applications will now break due to the constants changing? The typical usage appears to be switch (si->si_code) { case POLL_IN: ...; break; ... case POLL_ERR: ...; break; case POLL_HUP: ...; break; } This doesn't compile if some of the constants are equal. Boost has worked around FreeBSD's weirdness by placing a #if defined(POLL_ERR) && defined(POLL_HUP) && (POLL_ERR - POLL_HUP) around the case POLL_HUP. This #if does not hurt systems that have the POLL_* values all distinct. Given that the kernel does not generate these anyway, I considered this safe enough. True SIGIO, which is similar to SIGPOLL, always puts si_code=SI_KERNEL. -- Jilles Tjoelker