From ef8193051d4a2edd4931aceee5add29f70f629c0 Mon Sep 17 00:00:00 2001 From: "wtc%netscape.com" Date: Sat, 5 Jan 2002 01:37:05 +0000 Subject: [PATCH] Bugzilla bug 112987: correctly detect the FreeBSD versions in which poll() was added to libc and libc_r. Thanks to Jeremy Lea for pointing me at the FreeBSD Porter's Handbook. --- nsprpub/pr/include/md/_freebsd.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/nsprpub/pr/include/md/_freebsd.h b/nsprpub/pr/include/md/_freebsd.h index de4cf99ee07..5be48dbced4 100644 --- a/nsprpub/pr/include/md/_freebsd.h +++ b/nsprpub/pr/include/md/_freebsd.h @@ -37,7 +37,9 @@ #include "prthread.h" -#include +#if __FreeBSD__ >= 2 +#include /* for __FreeBSD_version */ +#endif #include #define PR_LINKER_ARCH "freebsd" @@ -66,16 +68,23 @@ #define _PR_HAVE_SOCKADDR_LEN #define _PR_STAT_HAS_ST_ATIMESPEC #define _PR_NO_LARGE_FILES -#if ( __FreeBSD_version >= 220000 ) && ( __FreeBSD_version < 400008 ) -#if !defined(_PR_PTHREADS) + +#if defined(_PR_PTHREADS) +#if __FreeBSD_version >= 400008 /* - * libc_r doesn't have poll(). Although libc has poll(), it is not - * thread-safe so we can't use it in the pthreads version. + * libc_r before this version of FreeBSD doesn't have poll(). + * Although libc has poll(), it is not thread-safe so we can't + * use it in the pthreads version. */ #define _PR_POLL_AVAILABLE +#endif +#else +#if __FreeBSD_version >= 300000 +#define _PR_POLL_AVAILABLE #define _PR_USE_POLL #endif #endif + #define _PR_HAVE_SYSV_SEMAPHORES #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY