]> granicus.if.org Git - zfs/commit
Replace check for _POSIX_MEMLOCK w/ HAVE_MLOCKALL
authorChris Dunlap <cdunlap@llnl.gov>
Tue, 1 Apr 2014 21:21:56 +0000 (14:21 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 2 Apr 2014 20:10:08 +0000 (13:10 -0700)
commit518eba14928ddf2c1871d33d4b0cdff7ec45bc23
treef931a00f963cc28f339558737970ec8328f0f2b0
parent904ea2763e6576f6971be4a684e6765aaea5221c
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 <cdunlap@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2
cmd/zed/zed.c
config/user.m4