From 271db2f6359b34c3ae3f0341486b07459a47c92d Mon Sep 17 00:00:00 2001 From: leonnicolas Date: Thu, 4 Jun 2020 14:50:42 +0200 Subject: [PATCH] README.md: some corrections --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 87e8f08..d9cbe68 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ # shared memory Simple example of inter process communication with shm_open(). -The main process forks itself and then waits for the child to finish. The child writes into a shared memory and exits. After that the main process prints what the child wrote into the shared memory. +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. +```bash +rm -f /dev/shm/SHARED_MEM +``` ## compile ```bash make