Xref: utzoo comp.lang.c:32009 comp.unix.programmer:72 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!munnari.oz.au!metro!gestetner!andrew From: andrew@gestetner.oz (Andrew Hunt) Newsgroups: comp.lang.c,comp.unix.programmer Subject: shared memory Keywords: shared memory Message-ID: <566@gestetner.oz> Date: 21 Sep 90 02:05:24 GMT Reply-To: andrew@gestetner.oz (Andrew Hunt) Organization: Gestetner Lasers, Sydney. Lines: 31 I am having problems with UNIX shared memory system functions (shmget, shmctl, shmop) - our system is SUN O/S 4.0.x. I am trying to attach some data to a shared memory identifier. assign global_start_address assign global_size global_shmid = shmget(IPC_PRIVATE,global_size,0777|IPC_CREAT); shmat(global_shmid,global_start_address,SHM_RDONLY); The shmget is always successful but the shmat fails. I have tried to assign the global_start_address to many different sizes and addresses. The addresses I have tried have been from malloc'ed memory, stack space, initialised data space, uninitialised data space.... I have experimented with changing permissions and have changed most of the parameters but the only thing that has worked is to set global_start_address = (char *)0; which allow the system to find some space for me. Does anyone know what areas of memory can be legally attached to shared memory? Thanks, Andrew Hunt PS: if it helps we are trying to set up the global data space of several UNIX processes to use common memory so that we can simulate the shared memory of an imbedded controller.