mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-04 19:25:56 +01:00
Fix “MAP_ANONYMOUS undefined” error on OSX.
This commit is contained in:
parent
ac3611bb19
commit
91676d1dda
@ -148,6 +148,11 @@ void *CartesianCommunicator::ShmBufferTranslate(int rank,void * local_p) {
|
||||
void CartesianCommunicator::ShmInitGeneric(void){
|
||||
#if 1
|
||||
|
||||
#if !defined(MAP_ANONYMOUS)
|
||||
#define NO_MAP_ANONYMOUS
|
||||
#define MAP_ANONYMOUS MAP_ANON
|
||||
#endif
|
||||
|
||||
int mmap_flag = MAP_SHARED | MAP_ANONYMOUS;
|
||||
#ifdef MAP_HUGETLB
|
||||
if ( Hugepages ) mmap_flag |= MAP_HUGETLB;
|
||||
@ -162,6 +167,11 @@ void CartesianCommunicator::ShmInitGeneric(void){
|
||||
ShmCommBuf=(void *)&ShmBufStorageVector[0];
|
||||
#endif
|
||||
bzero(ShmCommBuf,MAX_MPI_SHM_BYTES);
|
||||
|
||||
#if defined(NO_MAP_ANONYMOUS)
|
||||
#undef MAP_ANONYMOUS
|
||||
#undef NO_MAP_ANONYMOUS
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user