|
|
@ -36,8 +36,8 @@ namespace NLMISC {
|
|
|
|
// Storage for file handles, necessary to close the handles
|
|
|
|
// Storage for file handles, necessary to close the handles
|
|
|
|
map<void*,HANDLE> AccessAddressesToHandles;
|
|
|
|
map<void*,HANDLE> AccessAddressesToHandles;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
// Storage for shmid, necessary to destroy the segments
|
|
|
|
// Storage for shmid, necessary to destroy the segments
|
|
|
|
map<TSharedMemId, int> SharedMemIdsToShmids;
|
|
|
|
map<TSharedMemId, sint> SharedMemIdsToShmids;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -71,7 +71,7 @@ void *CSharedMemory::createSharedMemory( TSharedMemId sharedMemId, uint32 size
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
|
// Create a shared memory segment
|
|
|
|
// Create a shared memory segment
|
|
|
|
int shmid = shmget( sharedMemId, size, IPC_CREAT | IPC_EXCL | 0666 );
|
|
|
|
sint shmid = shmget( sharedMemId, size, IPC_CREAT | IPC_EXCL | 0666 );
|
|
|
|
if ( shmid == -1 )
|
|
|
|
if ( shmid == -1 )
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
SharedMemIdsToShmids.insert( make_pair( sharedMemId, shmid ) );
|
|
|
|
SharedMemIdsToShmids.insert( make_pair( sharedMemId, shmid ) );
|
|
|
@ -82,6 +82,7 @@ void *CSharedMemory::createSharedMemory( TSharedMemId sharedMemId, uint32 size
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return accessAddress;
|
|
|
|
return accessAddress;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|