1
0
mirror of https://github.com/PDP-10/klh10.git synced 2026-04-16 00:21:30 +00:00

Use configure for mlockall(2).

The set of OSes for was inconsistent and wrong (NetBSD has it too).
This commit is contained in:
Olaf Seibert
2016-01-25 01:14:49 +01:00
parent 3aafe75ece
commit 105ec2c0a8
5 changed files with 6 additions and 6 deletions

View File

@@ -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.

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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",

View File

@@ -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 <sys/mman.h>
#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.