From owner-freebsd-hackers Tue Mar 12 14: 1:27 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from loquat.bbn.com (crodrigues.bbn.com [128.89.72.49]) by hub.freebsd.org (Postfix) with ESMTP id 2298437B416 for ; Tue, 12 Mar 2002 14:01:08 -0800 (PST) Received: (from crodrigu@localhost) by loquat.bbn.com (8.11.2/8.11.2) id g2CM17I01720; Tue, 12 Mar 2002 17:01:07 -0500 Date: Tue, 12 Mar 2002 17:01:07 -0500 From: Craig Rodrigues To: Terry Lambert Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to correctly detect POSIX 1003.1b features on FreeBSD? Message-ID: <20020312170107.A1666@bbn.com> References: <20020312140904.A799@bbn.com> <3C8E742C.7C2E63B8@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C8E742C.7C2E63B8@mindspring.com>; from tlambert2@mindspring.com on Tue, Mar 12, 2002 at 01:33:32PM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Mar 12, 2002 at 01:33:32PM -0800, Terry Lambert wrote: > > If I read the posix4(9) man page, it says that > > I need to check _POSIX_VERSION, _POSIX_C_SOURCE, and > > _POSIX_SOURCE macros to detect what POSIX features > > are available. > > THat's *CHECK*, _not_ *SET*. If something begins with an "_", > it's for you to check, not for you to set. I understand. I didn't write the code in ACE that sets _P1003_1B_VISIBLE, so I am trying to fix it in the correct manner. > > #if (!defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)) || \ > > (_POSIX_VERSION >= 199309L && defined(_POSIX_C_SOURCE) && \ > > _POSIX_C_SOURCE >= 199309L) > > #define _P1003_1B_VISIBLE > > #define _P1003_1B_VISIBLE_HISTORICALLY > > #endif The other question I have is, when is _P1003_1B_VISIBLE actually defined? In , it looks like that _P1003_1B_VISIBLE is only defined if _KERNEL is defined. So, this macro is only defined if you are compiling kernel code. For user-level (not kernel level) code, is it better to check the _POSIX_SOURCE, _POSIX_VERSION, and _POSIX_C_SOURCE myself, with: #if (!defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)) || \ (_POSIX_VERSION >= 199309L && defined(_POSIX_C_SOURCE) && \ _POSIX_C_SOURCE >= 199309L) /* put code which requires 1003.1b here */ #endif Also, can someone tell me what _POSIX_VERSION expand to on FreeBSD current? On FreeBSD 4.3, it expands to: 199009L What is the status of the asynch I/O code in FreeBSD current? Is it compiled in by default, or is it still an option? Thanks. -- Craig Rodrigues Distributed Systems and Logistics, Office 6/304 crodrigu@bbn.com BBN Technologies, a Verizon company (617) 873-4725 Cambridge, MA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message