From d19a8351c829b6d976b653363b1251fcb9b25344 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Tue, 7 Nov 2017 16:38:16 +0900 Subject: [PATCH] memory/patcher: #ifdef out some parts when SYS_munmap is not defined so memory/patcher can work under cygwin Thanks Marco Atzeri for bringing this to our attention Signed-off-by: Gilles Gouaillardet --- opal/mca/memory/patcher/memory_patcher_component.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opal/mca/memory/patcher/memory_patcher_component.c b/opal/mca/memory/patcher/memory_patcher_component.c index 5504c9c841..bf676dbdca 100644 --- a/opal/mca/memory/patcher/memory_patcher_component.c +++ b/opal/mca/memory/patcher/memory_patcher_component.c @@ -13,7 +13,7 @@ * 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 + * Copyright (c) 2016-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. * @@ -152,6 +152,7 @@ static void *intercept_mmap(void *start, size_t length, int prot, int flags, int #endif +#if defined (SYS_munmap) static int (*original_munmap) (void *, size_t); static int _intercept_munmap(void *start, size_t length) @@ -178,6 +179,8 @@ static int intercept_munmap(void *start, size_t length) return result; } +#endif + #if defined (SYS_mremap) #if defined(__linux__) @@ -484,10 +487,12 @@ static int patcher_open (void) } #endif +#if defined (SYS_munmap) rc = opal_patcher->patch_symbol ("munmap", (uintptr_t)intercept_munmap, (uintptr_t *) &original_munmap); if (OPAL_SUCCESS != rc) { return rc; } +#endif #if defined (SYS_mremap) rc = opal_patcher->patch_symbol ("mremap",(uintptr_t)intercept_mremap, (uintptr_t *) &original_mremap);