The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


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:
Permission is denied to unlink the named shared memory object.
The length of the name string exceeds {NAME_MAX} while _POSIX_NO_TRUNC is in effect.
The named shared memory object does not exist.
The function shm_unlink() is not supported by this implementation.








close(), mmap(), munmap(), shmat(), shmctl(), shmdt(), shm_open(), <sys/mman.h>.


Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]