Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (s and S) shmget(2)
NAME
shmget - Creates a new shared memory segment or returns the identifier of an existing shared
memory segment
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossksrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZOSSKDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zosskdll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yosskdll
SYNOPSIS
#include <sys/shm.h>
int shmget(
key_t key,
size_t size,
int shmflag);
PARAMETERS
key Specifies the key that identifies the shared memory segment. The
IPC_PRIVATE key can be used to ensure the return of a new (unused) shared
memory identifier.
size Specifies the minimum number of bytes to allocate for the shared memory seg-
ment.
shmflag Specifies the access mode value to use for the segment, logically ORed with the
creation flag value to use for the segment.
The access mode value occupies the least-significant nine bits of the parameter.
These bits can be set by logically ORing any of the following symbolic values
defined in the sys/stat.h header file:
S_IRGRP
S_IROTH
S_IRUSR
S_IRWXG
S_IRWXO
S_IRWXU
S_IWGRP
S_IWOTH
S_IWUSR
S_IXGRP
S_IXOTH
S_IXUSR
Refer to the chmod(2) reference page for more information about the correct use
of these symbolic values.
The following creation flag values are valid:
IPC_CREAT If the key does not exist, the shmget() function creates a shared
memory identifier using the given key.
IPC_CREAT | IPC_EXCL
If the key already exists, the shmget() function fails and returns
an error notification.
527186-023 Hewlett-Packard Company 785