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

 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(), mmap(), munmap(), shmat(), shmctl(), shmdt(), shm_open(), <sys/mman.h>.

DERIVATION

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 ]