From b51c4e27972acf38de93874e096f21689c2e5abf Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 16 Mar 2017 05:43:51 -0700 Subject: [PATCH] memory/patcher: fix a compiler warning Don't define the madvise intercept functions since we're not currently intercepting madvise. Signed-off-by: Jeff Squyres --- .../mca/memory/patcher/memory_patcher_component.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/opal/mca/memory/patcher/memory_patcher_component.c b/opal/mca/memory/patcher/memory_patcher_component.c index c49cb8ce51..991bc3c852 100644 --- a/opal/mca/memory/patcher/memory_patcher_component.c +++ b/opal/mca/memory/patcher/memory_patcher_component.c @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved * Copyright (c) 2013-2017 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2016 Research Organization for Information Science @@ -59,6 +59,11 @@ static int patcher_query (int *); static int mca_memory_patcher_priority; +/* NTH: we can't currently allow madvise to be intercepted due to a + * deadlock when running with glibc. In the future, we may re-enable + * this hook if the deadlock can be resolved. */ +#define WANT_INTERCEPT_MADVISE 0 + opal_memory_patcher_component_t mca_memory_patcher_component = { .super = { .memoryc_version = { @@ -244,6 +249,7 @@ static void *intercept_mremap (void *start, size_t oldlen, void *new_address, si #endif +#if WANT_INTERCEPT_MADVISE #if defined (SYS_madvise) static int (*original_madvise) (void *, size_t, int); @@ -278,6 +284,7 @@ static int intercept_madvise (void *start, size_t length, int advice) } #endif +#endif // WANT_INTERCEPT_MADVISE #if defined SYS_brk @@ -496,16 +503,14 @@ static int patcher_open (void) } #endif - /* NTH: we can't currently allow madvise to be intercepted due to a deadlock when running with glibc. in - * the future we may re-enable this hook if the deadlock can be resolved. */ -#if 0 +#if WANT_INTERCEPT_MADVISE #if defined (SYS_madvise) rc = opal_patcher->patch_symbol ("madvise", (uintptr_t)intercept_madvise, (uintptr_t *) &original_madvise); if (OPAL_SUCCESS != rc) { return rc; } #endif -#endif +#endif // WANT_INTERCEPT_MADVISE #if defined(SYS_shmdt) && defined(__linux__) rc = opal_patcher->patch_symbol ("shmdt", (uintptr_t) intercept_shmdt, (uintptr_t *) &original_shmdt);