Portability fix: better checking for MAP_ANONYMOUS and MAP_ANON.
Thanks to Paul Hargrove for identifying the issue and suggesting the fix. This commit was SVN r30227.
Этот коммит содержится в:
родитель
d9f144d09f
Коммит
448a4707ce
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -26,6 +27,13 @@
|
||||
#include <infiniband/verbs.h>
|
||||
#endif /* MPAGE_ENABLE */
|
||||
|
||||
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
|
||||
# define MAP_ANONYMOUS MAP_ANON
|
||||
#endif /* MAP_ANONYMOUS and MAP_ANON */
|
||||
#if !defined(MAP_FAILED)
|
||||
# define MAP_FAILED ((char*)-1)
|
||||
#endif /* MAP_FAILED */
|
||||
|
||||
extern char* mca_memheap_base_param_hca_name;
|
||||
|
||||
static int _shm_attach(map_segment_t *, size_t, int, int);
|
||||
@ -278,9 +286,7 @@ static int _mmap_attach(map_segment_t *s, size_t size)
|
||||
size,
|
||||
PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED |
|
||||
#if defined (__APPLE__)
|
||||
MAP_ANON |
|
||||
#elif defined (__GNUC__)
|
||||
#if defined(MAP_ANONYMOUS)
|
||||
MAP_ANONYMOUS |
|
||||
#endif
|
||||
MAP_FIXED,
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user