From owner-freebsd-current Sun Mar 4 11:12:56 2001 Delivered-To: freebsd-current@freebsd.org Received: from hda.hda.com (host65.hda.com [63.104.68.65]) by hub.freebsd.org (Postfix) with ESMTP id 8404037B718 for ; Sun, 4 Mar 2001 11:12:48 -0800 (PST) (envelope-from dufault@hda.hda.com) Received: (from dufault@localhost) by hda.hda.com (8.11.1/8.11.1) id f24JCYq46536 for current@freebsd.org; Sun, 4 Mar 2001 14:12:34 -0500 (EST) (envelope-from dufault) From: Peter Dufault Message-Id: <200103041912.f24JCYq46536@hda.hda.com> Subject: Posix feature tests update To: current@freebsd.org Date: Sun, 4 Mar 2001 14:11:58 -0500 (EST) X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Critique, please. I'm building a large body of code with the following cc options: > -D_POSIX_VERSION=199506L -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199506L and one of my own: > -D_P1003_1G_VISIBLE together with locally hacked up headers. Here's how I'm hacking. This could go into current if no one objects. 1. In "sys/_posix.h" the test macro _BSD_TRADITIONAL is defined if neither _POSIX_SOURCE nor _POSIX_C_SOURCE are defined. In most system headers, those items currently bracketed by > #ifndef _POSIX_SOURCE instead are bracketed by > #ifdef _BSD_TRADITIONAL 2. What I'd previously put in sys/_posix.h as > #define _P1003_1B_VISIBLE is replaced by > #define _P1003_1_199309 The notion is that prior to a draft being finalized it is fine to select it with _P1003_1B_VISIBLE (or _P1003_1G_VISIBLE) since you don't know the final _POSIX_VERSION and it should be viewed with suspicion, but once it is finalized it should be replaced by the _POSIX_VERSION numeric id. 3. I'd get rid of the verbose and unclear: #define _P1003_1B_VISIBLE_HISTORICALLY and replace it with the inline (that is, repeated in the headers) test > #if defined(_BSD_TRADITIONAL) || defined(_P1003_1_199309) 4. Everything added in the 1995 P1003.1 is bracketed by > #ifdef _P1003_1_199506 or > #if defined(_BSD_TRADITIONAL) || defined(_P1003_1_199506) as appropriate, i.e. if brand new it gets the first test, if pre-existing it gets the second. 5. Those items from the draft Posix 1003.1-G are bracketed by _P1003_1G_VISIBLE optionally or'd with _BSD_TRADITIONAL, as needed. -- It is useful to specify the Posix version, but right now the lack of networking support makes it only marginally useful. Peter -- Peter Dufault (dufault@hda.com) Realtime development, Machine control, HD Associates, Inc. Fail-Safe systems, Agency approval To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message