1
1

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 <gilles@rist.or.jp>
Этот коммит содержится в:
Gilles Gouaillardet 2017-11-07 16:38:16 +09:00
родитель ec6b2e1cf1
Коммит d19a8351c8

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

@ -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);