diff --git a/configure.ac b/configure.ac index dc78d1de..eb733eb3 100644 --- a/configure.ac +++ b/configure.ac @@ -263,6 +263,14 @@ case "$host_os" in OS_DYFLAGS="-export-dynamic" DARWIN_OPTS="" OS_LDL="" + case "$host_os" in + *freebsd[[234567]]*) + ;; + *freebsd*) + AC_DEFINE_UNQUOTED([COROSYNC_FREEBSD_GE_8], [1], + [Compiling for FreeBSD >= 8 platform]) + ;; + esac ;; *solaris*) AC_DEFINE_UNQUOTED([COROSYNC_SOLARIS], [1], diff --git a/exec/main.c b/exec/main.c index 951b13da..c27c7135 100644 --- a/exec/main.c +++ b/exec/main.c @@ -404,7 +404,7 @@ static void corosync_tty_detach (void) static void corosync_mlockall (void) { -#if !defined(COROSYNC_BSD) +#if !defined(COROSYNC_BSD) || defined(COROSYNC_FREEBSD_GE_8) int res; #endif struct rlimit rlimit; @@ -417,8 +417,8 @@ static void corosync_mlockall (void) setrlimit (RLIMIT_VMEM, &rlimit); #endif -#if defined(COROSYNC_BSD) - /* under FreeBSD a process with locked page cannot call dlopen +#if defined(COROSYNC_BSD) && !defined(COROSYNC_FREEBSD_GE_8) + /* under FreeBSD < 8 a process with locked page cannot call dlopen * code disabled until FreeBSD bug i386/93396 was solved */ log_printf (LOGSYS_LEVEL_WARNING, "Could not lock memory of service to avoid page faults\n");