Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2002 14:09:04 -0500
From:      Craig Rodrigues <crodrigu@bbn.com>
To:        freebsd-hackers@freebsd.org
Subject:   How to correctly detect POSIX 1003.1b features on FreeBSD?
Message-ID:  <20020312140904.A799@bbn.com>

next in thread | raw e-mail | index | archive | help
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 <sys/_posix.h>, 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 <signal.h>, 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020312140904.A799>