1
1

Support to handle platforms which do not define RLIMIT_MEMLOCK

This commit was SVN r20035.
Этот коммит содержится в:
Donald Kerr 2008-11-25 03:13:09 +00:00
родитель 16598d7d39
Коммит 668eafec88
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -1016,6 +1016,16 @@ AC_INCLUDES_DEFAULT
#include <sys/resource.h>
#endif])
#
# Do we have RLIMIT_MEMLOCK in <sys/resources.h>? (e.g., Solaris does not)
#
AC_CHECK_DECLS([RLIMIT_MEMLOCK], [], [], [
AC_INCLUDES_DEFAULT
#if HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif])
# checkpoint results
AC_CACHE_SAVE

Просмотреть файл

@ -15,6 +15,7 @@
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2006-2007 Voltaire All rights reserved.
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -106,7 +107,11 @@ static void show_init_error(const char *file, int line,
struct rlimit limit;
char *str_limit = NULL;
#if HAVE_DECL_RLIMIT_MEMLOCK
ret = getrlimit(RLIMIT_MEMLOCK, &limit);
#else
ret = -1;
#endif
if (0 != ret) {
asprintf(&str_limit, "Unknown");
} else if (limit.rlim_cur == RLIM_INFINITY) {