shm_unlink - remove a shared memory object (REALTIME)
#include <sys/mman.h> int shm_unlink(const char * name);
The shm_unlink() function removes the name of the shared memory object named by the string pointed to by name. If one or more references to the shared memory object exist when the object is unlinked, the name is removed before shm_unlink() returns, but the removal of the memory object contents is postponed until all open and map references to the shared memory object have been removed.
Upon successful completion, a value of zero is returned. Otherwise, a value of -1 is returned and errno will be set to indicate the error. If -1 is returned, the named shared memory object will not be changed by this function call.
The shm_unlink() function will fail if:
- [EACCES]
- Permission is denied to unlink the named shared memory object.
- [ENAMETOOLONG]
- The length of the name string exceeds {NAME_MAX} while _POSIX_NO_TRUNC is in effect.
- [ENOENT]
- The named shared memory object does not exist.
- [ENOSYS]
- The function shm_unlink() is not supported by this implementation.
None.
None.
None.
close(), mmap(), munmap(), shmat(), shmctl(), shmdt(), shm_open(), <sys/mman.h>.
Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)