Support to handle platforms which do not define RLIMIT_MEMLOCK
This commit was SVN r20035.
Этот коммит содержится в:
родитель
16598d7d39
Коммит
668eafec88
10
configure.ac
10
configure.ac
@ -1016,6 +1016,16 @@ AC_INCLUDES_DEFAULT
|
|||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#endif])
|
#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
|
# checkpoint results
|
||||||
AC_CACHE_SAVE
|
AC_CACHE_SAVE
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2006-2007 Voltaire All rights reserved.
|
* Copyright (c) 2006-2007 Voltaire All rights reserved.
|
||||||
|
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -106,7 +107,11 @@ static void show_init_error(const char *file, int line,
|
|||||||
struct rlimit limit;
|
struct rlimit limit;
|
||||||
char *str_limit = NULL;
|
char *str_limit = NULL;
|
||||||
|
|
||||||
|
#if HAVE_DECL_RLIMIT_MEMLOCK
|
||||||
ret = getrlimit(RLIMIT_MEMLOCK, &limit);
|
ret = getrlimit(RLIMIT_MEMLOCK, &limit);
|
||||||
|
#else
|
||||||
|
ret = -1;
|
||||||
|
#endif
|
||||||
if (0 != ret) {
|
if (0 != ret) {
|
||||||
asprintf(&str_limit, "Unknown");
|
asprintf(&str_limit, "Unknown");
|
||||||
} else if (limit.rlim_cur == RLIM_INFINITY) {
|
} else if (limit.rlim_cur == RLIM_INFINITY) {
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user