From 518eba14928ddf2c1871d33d4b0cdff7ec45bc23 Mon Sep 17 00:00:00 2001 From: Chris Dunlap Date: Tue, 1 Apr 2014 14:21:56 -0700 Subject: Replace check for _POSIX_MEMLOCK w/ HAVE_MLOCKALL zed supports a '-M' cmdline opt to lock all pages in memory via mlockall(). The _POSIX_MEMLOCK define is checked to determine whether this function is supported. The current test assumes mlockall() is supported if _POSIX_MEMLOCK is non-zero. However, this test is insufficient according to mlock(2) and sysconf(3). If _POSIX_MEMLOCK is -1, mlockall() is not supported; but if _POSIX_MEMLOCK is 0, availability must be checked at runtime. This commit adds an autoconf check for mlockall() to user.m4. The zed code block for mlockall() is now guarded with a test for HAVE_MLOCKALL. If defined, mlockall() will be called and its runtime availability checked via its return value. Signed-off-by: Chris Dunlap Signed-off-by: Brian Behlendorf Issue #2 --- config/user.m4 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/user.m4 b/config/user.m4 index 6c127820c..38024370b 100644 --- a/config/user.m4 +++ b/config/user.m4 @@ -13,4 +13,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [ ZFS_AC_CONFIG_USER_LIBBLKID ZFS_AC_CONFIG_USER_FRAME_LARGER_THAN ZFS_AC_CONFIG_USER_RUNSTATEDIR +dnl # +dnl # Checks for library functions + AC_CHECK_FUNCS([mlockall]) ]) -- cgit v1.2.3