mirror_zfs/cmd/zed
Chris Dunlap 518eba1492 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
2014-04-02 13:10:08 -07:00
..
zed.d Add automatic hot spare functionality 2014-04-02 13:10:08 -07:00
.gitignore Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
Makefile.am Add automatic hot spare functionality 2014-04-02 13:10:08 -07:00
zed_conf.c Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_conf.h Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_event.c Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_event.h Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_exec.c Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_exec.h Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_file.c Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_file.h Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_log.c Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_log.h Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_strings.c Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed_strings.h Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
zed.c Replace check for _POSIX_MEMLOCK w/ HAVE_MLOCKALL 2014-04-02 13:10:08 -07:00
zed.h Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00