Skip to content
Advertisement

Tag: shared-memory

Putting a Struct into Shared Memory

I have created two programs a server.c and a client.c. I have a struct that holds an age. I have got the programs working together to read the shared memory and to change the shared memory, however this only works when using one variable in the struct. As soon as i have more than one variable in the struct i

Playing with shmat and shm_open

I just read the manpages for shm_open and shmat and was trying out the following example. In a file test.c I do, And in a wrapper file I do, I tried adding in a strerror(errno) at test.c and I get Identifier removed. What does that mean? What am I doing wrong? Given a shared memory identifier(shmid), shouldn’t I be able

Sharing memory between processes through the use of mmap()

I’m in Linux 2.6. I have an environment where 2 processes simulate (using shared memory) the exchange of data through a simple implementation of the message passing mode. I have a client process (forked from the parent, which is the server) which writes a struct(message) to a memory mapped region created (after the fork) with: message *m = mmap(NULL, sizeof(message),

Advertisement