They provide a simple interface to the System V shared memory system calls plus additional built-in functionality. Each time a shared memory block is created, it is automatically attached. Also, a semaphore is created. Key generation is accomplished inside the function. Creates and attaches a shared memory segment of size bytes.
Key generation is accomplished using the parameter key value.
The key value is used only to generate a shared memory block, the key used to generate the accompanying semaphore is randomly generated. Currently this function always returns 1. Note that no checks are made as to whether any processes have any exclusive or non-exclusive locks on the semaphore prior to removing it. Delete all shared memory segments we've created. Note that if a shared memory block is still attached to some process, it will not be deleted.