Remove a shared memory object
#include <sys/mman.h> int shm_unlink( const char * name );
- The name of the shared memory object that you want to remove.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The shm_unlink() function removes the name of the shared memory object specified by name. After removing the name, you can't use shm_open() to access the object.
This function doesn't affect any references to the shared memory object (i.e. file descriptors or memory mappings). If more than one reference to the shared memory object exists, then the link count is decremented, but the shared memory segment isn't actually removed until you remove all open and map references to it.
- An error occurred ( errno is set).
- Permission to unlink the shared memory object is denied.
- Too many levels of symbolic links or prefixes.
- The length of the name argument exceeds NAME_MAX.
- The named shared memory object doesn't exist, or the name argument points to an empty string.
- The shm_unlink() function isn't supported by this implementation.
Last modified: 2014-06-24