NAME
shm_unlink —
remove a shared memory object (REALTIME)
SYNOPSIS
#include <sys/mman.h> int shm_unlink(const char * name);
DESCRIPTION
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.
RETURN VALUE
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.
ERRORS
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.
EXAMPLES
None.
APPLICATION USAGE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
close(3) , mmap(3) , munmap(3) , shmat(3) , shmctl(3) , shmdt(3) , shm_open(3) , <sys/mman.h> .
DERIVATION
Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)