From owner-freebsd-hackers Tue Mar 12 11: 9: 8 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 B31F937B400 for ; Tue, 12 Mar 2002 11:09:04 -0800 (PST) Received: (from crodrigu@localhost) by loquat.bbn.com (8.11.2/8.11.2) id g2CJ94A00844 for freebsd-hackers@freebsd.org; Tue, 12 Mar 2002 14:09:04 -0500 Date: Tue, 12 Mar 2002 14:09:04 -0500 From: Craig Rodrigues To: freebsd-hackers@freebsd.org Subject: How to correctly detect POSIX 1003.1b features on FreeBSD? Message-ID: <20020312140904.A799@bbn.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i 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 Hi, I am currently using FreeBSD 4.3, and am working with ACE, a cross-platform C++ library for doing systems programming (networking, threading, I/O, etc.). I am having problems with the configuration of ACE on FreeBSD, related to POSIX 1003.1b features. Can someone tell me how a user can, at compile time, determine the presence or absence of POSIX 1003.1b features such as: sigwaitinfo sigtimedwait sigqueue Currently, I have some code that does: #if (__FreeBSD_version > 440000) # define _P1003_1B_VISIBLE # define ACE_HAS_AIO_CALLS # define SIGRTMIN 32 # define SIGRTMAX (_SIG_MAXSIG - 1) #endif This test is wrong, because it fails on FreeBSD 4.5. 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. If I look in , I see: #ifdef _KERNEL . . . #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 . . . #endif Can I re-use this test to determine if I have the POSIX 1003.1b functions: sigwaitinfo, sigtimedwait, sigqueue available? In , I see the following: #ifdef _P1003_1B_VISIBLE __BEGIN_DECLS int sigqueue __P((_BSD_PID_T_, int, const union sigval)); int sigtimedwait __P((const sigset_t *, siginfo_t *, const struct timespec *)); int sigwaitinfo __P((const sigset_t *, siginfo_t *)); __END_DECLS #endif Any clarification on how to correctly detect and use these features, would be appreciated. -- 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