diff --git a/configure.ac b/configure.ac index c16adec..10fe412 100644 --- a/configure.ac +++ b/configure.ac @@ -103,7 +103,7 @@ AC_FUNC_REALLOC AC_CHECK_FUNCS([alarm dup2 gettimeofday localtime_r memset socket strcasecmp \ strchr strcspn strerror strncasecmp strpbrk strrchr strtol \ getifaddrs if_nameindex sigaction nanosleep \ - gettimeofday getrusage setitimer tcsetattr]) + gettimeofday getrusage setitimer tcsetattr mlockall]) # Check for CPU. # This requires install-sh, config.sub, config.guess from automake. diff --git a/src/dpimp.c b/src/dpimp.c index 3516cf5..10c6a07 100644 --- a/src/dpimp.c +++ b/src/dpimp.c @@ -608,7 +608,7 @@ main(int argc, char **argv) /* And ensure its memory is locked too, since the lockage isn't ** inherited over a fork(). Don't bother warning if it fails. */ -#if CENV_SYS_DECOSF || CENV_SYS_SOLARIS || CENV_SYS_LINUX +#if HAVE_MLOCKALL (void) mlockall(MCL_CURRENT|MCL_FUTURE); #endif progname = progname_r; /* Reset progname to indicate identity */ diff --git a/src/dpni20.c b/src/dpni20.c index 78ce268..149fc2f 100644 --- a/src/dpni20.c +++ b/src/dpni20.c @@ -432,7 +432,7 @@ main(int argc, char **argv) /* And ensure its memory is locked too, since the lockage isn't ** inherited over a fork(). Don't bother warning if it fails. */ -#if CENV_SYS_DECOSF || CENV_SYS_SOLARIS || CENV_SYS_LINUX +#if HAVE_MLOCKALL (void) mlockall(MCL_CURRENT|MCL_FUTURE); #endif progname = progname_r; /* Reset progname to indicate identity */ diff --git a/src/dpsup.c b/src/dpsup.c index 75807d8..5284467 100644 --- a/src/dpsup.c +++ b/src/dpsup.c @@ -488,7 +488,7 @@ int dp_main(register struct dp_s *dp, int argc, char **argv) ** beforehand - only warn if an error isn't EPERM and hence is ** unusual. */ -#if CENV_SYS_DECOSF || CENV_SYS_SOLARIS || CENV_SYS_LINUX +#if HAVE_MLOCKALL if (mlockall(MCL_CURRENT|MCL_FUTURE) != 0) { if (errno != EPERM) fprintf(stderr, "[%s: mlockall failed - %s]\r\n", diff --git a/src/osdsup.c b/src/osdsup.c index 495859d..fa73788 100644 --- a/src/osdsup.c +++ b/src/osdsup.c @@ -1666,14 +1666,14 @@ os_mmkill(osmm_t mm, char *ptr) /* Attempt to lock all of our process memory now and in the future. */ -#if CENV_SYS_DECOSF || CENV_SYS_SOLARIS +#if HAVE_MLOCKALL # include #endif int os_memlock(int dolock) { -#if CENV_SYS_DECOSF || CENV_SYS_SOLARIS +#if HAVE_MLOCKALL /* Both Solaris and OSF/1 have mlockall() which looks like what we want. ** It requires being the super-user, but don't bother to check here, ** just return error if it fails for any reason.