[Previous] [Contents] [Next]

shm_unlink()

Remove a shared memory object

Synopsis:

#include <sys/mman.h>

int shm_unlink( const char * name );

Library:

libc

Description:

The shm_unlink() function removes the name of the shared memory object specified by name. If one or more references to the shared memory object exist, then the link count is decremented, and the removal of the shared memory segment is postponed until all open and map references have been removed.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EACCES
Permission to unlink the shared memory object is denied.
ELOOP
Too many levels of symbolic links or prefixes.
ENAMETOOLONG
The length of the name argument exceeds NAME_MAX.
ENOENT
The named shared memory object doesn't exist, or the name argument points to an empty string.
ENOSYS
The shm_unlink() function isn't supported by this implementation.

Classification:

POSIX 1003.1 (Realtime Extensions)

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

errno, mmap(), munmap(), mprotect(), shm_ctl(), shm_open()


[Previous] [Contents] [Next]