SHMEM: Fix all Linux code paths to only use shm_ APIs when available

This commit is contained in:
Mark Pizzolato 2020-07-09 08:27:57 -07:00
parent e2d0095010
commit a73ab48c0e

View file

@ -626,12 +626,14 @@ if ((*shmem)->shm_base == MAP_FAILED) {
*addr = (*shmem)->shm_base;
return SCPE_OK;
#else
*shmem = NULL;
return SCPE_NOFNC;
#endif
}
void sim_shmem_close (SHMEM *shmem)
{
#if defined (HAVE_SHM_OPEN)
if (shmem == NULL)
return;
if (shmem->shm_base != MAP_FAILED)
@ -642,6 +644,7 @@ if (shmem->shm_fd != -1) {
}
free (shmem->shm_name);
free (shmem);
#endif
}
int32 sim_shmem_atomic_add (int32 *p, int32 v)