|
NAMEshmget —
obtain a shared memory identifier
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <sys/shm.h>
int
DESCRIPTIONBased on the values of key and flag,shmget () returns the identifier of a newly created or
previously existing shared memory segment. The key is analogous to a filename:
it provides a handle that names an IPC object. There are three ways to specify
a key:
The mode of a newly created IPC object is determined by which are set by ORing these constants into the flag argument:
When creating a new shared memory segment, size indicates the desired size of the new segment in bytes. The size of the segment may be rounded up to a multiple convenient to the kernel (i.e., the page size). RETURN VALUESUpon successful completion,shmget () returns the
positive integer identifier of a shared memory segment. Otherwise, -1 is
returned and errno set to indicate the error.
ERRORSTheshmget () system call will fail if:
SEE ALSOshmat(2), shmctl(2), shmdt(2), ftok(3)
Visit the GSP FreeBSD Man Page Interface. |