shm_unlink(3P4)
NAME
shm_unlink − remove a memory object
SYNOPSIS
#include <sys/mman.h>
int shm_unlink(name)
char ∗name;
DESCRIPTION
The shm_unlink function removes the name of the memory object name. The name argument points to a null-terminated string naming a memory object. name must consist of less than {NAME_MAX} characters from the portable file name character set. Slash (/) characters are not allowed in name. The current working directory does not affect the interpretation of name.
If one or more references to the memory object exist when the object is unlinked, the name will be removed before shm_unlink returns, but the removal of the memory object’s contents will be postponed until the memory object is no longer mapped by any process.
RETURN VALUE
Upon successful completion, a value of zero will be returned. Otherwise, a value of -1 will be returned, and errno will be set to indicate the error. If -1 is returned, the named memory object will not be changed by this function call. Possible errors include:
[EACCES] Permission to unlink the memory object is denied.
[EINVAL] Invalid name argument.
[ENAMETOOLONG] The length of the name argument exceeds {NAME_MAX}
[ENOENT] The named memory object does not exist, or the name argument points to an empty string.
FILES
/usr/lib/libposix4.a
SEE ALSO
mmap(3P4), munmap(3P4), shm_open(3P4), "CX/UX Programmer’s Guide"
WARNING
The interface to shm_unlink is based on IEEE Draft Standard P1003.4/D12. This is an unapproved draft, subject to change. Use of information contained in this unapproved draft is at your own risk. This interface will change to reflect any changes made by future drafts of POSIX 1003.4.
CX/UX Programmer’s Reference Manual