From owner-freebsd-hackers Tue Mar 12 16:35:25 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 D86DD37B400 for ; Tue, 12 Mar 2002 16:35:15 -0800 (PST) Received: (from crodrigu@localhost) by loquat.bbn.com (8.11.2/8.11.2) id g2D0ZEJ02247; Tue, 12 Mar 2002 19:35:14 -0500 Date: Tue, 12 Mar 2002 19:35:14 -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: <20020312193514.A2226@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 Hi, I compiled this simple program with gcc 2.95 on FreeBSD 4.3: #include int main(int argc, char *argv[]) { sigqueue(0,0,(union sigval)0); sigtimedwait((sigset_t *)0, (siginfo_t *)0, (struct timespec *)0); sigwaitinfo((sigset_t *)0, (siginfo_t *)0); return 0; } % gcc test.c /tmp/cc6AHohn.o: In function `main': /tmp/cc6AHohn.o(.text+0x11): undefined reference to `sigqueue' /tmp/cc6AHohn.o(.text+0x22): undefined reference to `sigtimedwait' /tmp/cc6AHohn.o(.text+0x31): undefined reference to `sigwaitinfo' If I look in signal.h, I find: #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 So, apparently _P1003_1B_VISIBLE is somehow being defined by the header files, but these particular functions are not available. Can someone tell me how I can detect if these functions are available on a system at compile time? I cannot use an autoconf type of test, and need to use a preprocessor macro type of test. It seems to me that this particular definition of _P1003_1B_VISIBLE is broken if it is enabling symbols in header files to appear which cannot be linked on a generically configured FreeBSD system. 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