From owner-svn-src-head@freebsd.org Fri Feb 12 20:29:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C1BDAA61C0; Fri, 12 Feb 2016 20:29:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 133D71E8E; Fri, 12 Feb 2016 20:29:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c110-21-41-193.carlnfd1.nsw.optusnet.com.au (c110-21-41-193.carlnfd1.nsw.optusnet.com.au [110.21.41.193]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 58B45D46744; Sat, 13 Feb 2016 07:29:49 +1100 (AEDT) Date: Sat, 13 Feb 2016 07:29:48 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include In-Reply-To: <20160212173641.GV91220@kib.kiev.ua> Message-ID: <20160213070506.N2501@besplex.bde.org> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> <20160212143630.GS91220@kib.kiev.ua> <20160213021939.S1340@besplex.bde.org> <20160212173641.GV91220@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=R4L+YolX c=1 sm=1 tr=0 a=73JWPhLeruqQCjN69UNZtQ==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=k41GPJUOWNQkfJVGFsEA:9 a=rDLYWgRMfs3qs9-j:21 a=ljb_BbTqrRM-5nSN:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 20:29:52 -0000 On Fri, 12 Feb 2016, Konstantin Belousov wrote: > On Sat, Feb 13, 2016 at 03:56:42AM +1100, Bruce Evans wrote: >> Our Standard C namespace is a subset of the POSIX namespace. Most >> Standard C headers are (were) careful about this. There aren't many >> Standard C headers or versions of Standard C or large variations in the >> versions, so this is relatively easy to do. >> >> We also attempt to use POSIX visibility ifdefs. This is not done so >> carefully, and has more bugs due to more variations. But >> does it fairly carefully. It has ifdefs for XSI, POSIX >= 2001, >> >> I find the ifdefs useful for seeing when POSIX introduced a feature >> but not for actual use to compile under an old standard. > > So you are about the ANSI C & non-POSIX compilation environment ? > Do you mean the following: > > diff --git a/include/signal.h b/include/signal.h > index 33be55c..31cded7 100644 > --- a/include/signal.h > +++ b/include/signal.h > @@ -36,8 +36,10 @@ > #include > #include > #include > +#if __POSIX_VISIBLE || __XSI_VISIBLE > #include > #include > +#endif > > #if __BSD_VISIBLE > /* > > I can change #if __POSIX_VISIBLE to some version cap, if you prefer. It needs a version number to be correct. Plain __POSIX_VISIBLE means all versions. __POSIX_VISBLE >= 200112 is probably good enough for the POSIX part. I don't know the correct number for XSI. Perhaps it can be simply omitted. _XOPEN_SOURCE >= 600 gives __XSI_VISIBLE >= 600 && _POSIX_C_SOURCE >= 200112. So __XSI_VISIBLE in the above is only to support XSI before 2001. We only support 1 XSI before that -- #500 which corresponds to 1996 POSIX. Very likely XSI did have ucontext_t then, so the above ifdef is correct. It is just hard to read. Easier than google hits though :-). I found a gnu man page about getcontext() being in SVID but couldn't easily find the history. Bruce