Using shared memory and how to correctly unallocate a space with IPC_RMID
问题 I have 2 applications running on my linux box, a server and a client. My server and client examples I am working with is from Dave Marshalls examples. Everything works well, but when I try this in my background process and I want to extend my original segment (perhaps due to an application upgrade in the future) I either have to change my key or somehow pass the shmctl(shmid, IPC_RMID, 0) call in my app. Since my app cannot exit graciously and I cannot set this right at the beginning after