summaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-09-18 17:24:53 +0200
committerWerner Koch <wk@gnupg.org>1998-09-18 17:24:53 +0200
commitb4aeef458c51b9debd394592e76b93cc6b00e0a2 (patch)
treee87818f5c15e12189f5fc054faf6d09e07e3d120 /acinclude.m4
parentMichael Roth has released is des impl. (diff)
downloadgnupg2-b4aeef458c51b9debd394592e76b93cc6b00e0a2.tar.xz
gnupg2-b4aeef458c51b9debd394592e76b93cc6b00e0a2.zip
.
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 6fe4337f4..b6c1f656f 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.