Example of inter process communication with shm_open().
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
leonnicolas c7025e2da9
main.c: spello
4 years ago
Makefile initial commit 4 years ago
README.md README.md: some corrections 4 years ago
main.c main.c: spello 4 years ago
noerror.c initial commit 4 years ago

README.md

shared memory

Simple example of inter process communication with shm_open().

The main process forks itself and then prints whatever the child writes into te shared memory. The child writes 5 time "hallo <#>" and then exits. After printing 5 times whatever the child wrote, the main process unlinks the shared memory object.

Note

The file noerror.c does the same as main.c, but no error handling.

If you kill the process before exiting, you need to close the shared memory object manually.

rm -f /dev/shm/SHARED_MEM

compile

make

run

./main