summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2002-01-05 01:43:00 +0000
committerwtc%netscape.com <devnull@localhost>2002-01-05 01:43:00 +0000
commit6e43d749d1d1df0b690a4e820c27a8ad0ba4394d (patch)
treeb156eb7632850a2a3c55830eb98365cdb62e59f8
parent27bafde67e79334d9c53ccda47921aafcca8d214 (diff)
downloadnspr-hg-6e43d749d1d1df0b690a4e820c27a8ad0ba4394d.tar.gz
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 to the FreeBSD Porter's Handbook. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r--pr/include/md/_freebsd.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/pr/include/md/_freebsd.h b/pr/include/md/_freebsd.h
index de4cf99e..5be48dbc 100644
--- a/pr/include/md/_freebsd.h
+++ b/pr/include/md/_freebsd.h
@@ -37,7 +37,9 @@
#include "prthread.h"
-#include <sys/param.h>
+#if __FreeBSD__ >= 2
+#include <osreldate.h> /* for __FreeBSD_version */
+#endif
#include <sys/syscall.h>
#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