|SHM_OPEN(3)||Library Functions Manual||SHM_OPEN(3)|
— create and destroy shared memory
char *path, int
shm_open() function opens a shared
memory object and returns a file descriptor suitable for use with
mmap(2). The flags
argument has the same meaning as provided to
open(2) and must include at least
O_RDWR and may
also include a combination of
implementation forces the mode to be 0600 or 0400, and
prohibits sharing between different UIDs.
shm_unlink() is used to remove a shared
memory object. The object is not freed until all references to it have been
released via close(2).
If a temporary shared memory object is desired, the
shm_mkstemp() function should be preferred as it
avoids several possible security holes that tend to appear in programs
trying to create their own unique temporary names. The
template argument is a string with at least six
trailing Xs as described in
shm_mkstemp() return a file descriptor on successful
completion. They may fail for any of the reasons listed in
shm_unlink() appear in IEEE Std
1003.1-2001 (“POSIX.1”). Using
shm_open() is an extension to that standard. This
implementation deviates from the standard by permitting less sharing.
shm_mkstemp() is an extension.
shm_mkstemp() functions have been available since
Ted Unangst <email@example.com>.
|May 5, 2015||OpenBSD-current|