summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-09-18 15:24:52 +0000
committerWerner Koch <wk@gnupg.org>1998-09-18 15:24:52 +0000
commit41d07973ca468dd49ecd2e06429a72b9b3756949 (patch)
tree5ebd03b9d30a9dd44f1f11dcd3935c0991c10a91 /acinclude.m4
parenta183c6e9f8a7cbac7127ae987e2f3f0704bd2abf (diff)
downloadlibgcrypt-41d07973ca468dd49ecd2e06429a72b9b3756949.tar.gz
.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m444
1 files changed, 44 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 6fe4337f..b6c1f656 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -155,6 +155,50 @@ define(WK_CHECK_IPC,
######################################################################
+# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock
+# is not called from uid 0 (not tested whether uid 0 works)
+######################################################################
+dnl WK_CHECK_MLOCK
+dnl
+define(WK_CHECK_MLOCK,
+ [ AC_CHECK_FUNCS(mlock)
+ if test "$ac_cv_func_mlock" = "yes"; then
+ AC_MSG_CHECKING(whether mlock is broken)
+ AC_TRY_RUN([
+ #include <unistd.h>
+ #include <errno.h>
+ #include <sys/mman.h>
+ #include <sys/types.h>
+ #include <fcntl.h>
+
+ int main()
+ {
+ char *pool;
+ int err;
+ long int pgsize = getpagesize();
+
+ pool = malloc( 4096 + pgsize );
+ if( !pool )
+ return 2;
+ pool += (pgsize - ((long int)pool % pgsize));
+
+ err = mlock( pool, 4096 );
+ if( !err || errno == EPERM )
+ return 0; /* okay */
+
+ return 1; /* hmmm */
+ }
+
+ ],
+ AC_MSG_RESULT(no),
+ AC_DEFINE(HAVE_BROKEN_MLOCK)
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(assuming no))
+ fi
+ ])
+
+
+######################################################################
# progtest.m4 from gettext 0.35
######################################################################
# Search path for a program which passes the given test.