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

shmget(2) OSS System Calls Reference Manual
Both Guardian and OSS processes can call SEGMENT_ALLOCATE_ and related Guardian pro-
cedure calls: they can share segments as described for SEGMENT_ALLOCATE_.
On servers running J06.12 or later J-series RVUs or H06.23 or later H-series RVUs, both Guar-
dian processes and OSS processes can call shmget() and related functions; they can share seg-
ments as described for shmget().
On servers running J06.11 or earlier J-series RVUs, H06.22 or earlier H-series RVUs, or G-series
RVUs, only OSS processes can call shmget() and related functions; Guardian process calls to
these functions fail and errno is set to the value of [ENOTOSS].
NOTES
The shared memory identifier is not the Guardian environment segid value or segment identifier.
Programs should not be written to depend upon the maximum number of attached shared seg-
ments. This limit is subject to change.
Refer to the SEGMENT_ALLOCATE_ procedure in the Guardian Procedure Calls Reference
Manual for more information about segment limits.
RETURN VALUES
Upon successful completion, a nonnegative shared memory identifier is returned. Otherwise, the
value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the shmget() function sets errno to the corresponding
value:
[EACCES] A shared memory identifier already exists for the key parameter, but operation
permission as specified by the low-order nine bits of the shmflag parameter was
not granted.
[EEXIST] A shared memory identifier already exists for the key parameter, but
IPC_CREAT and IPC_EXCL were both set in the shmflag parameter.
[EINVAL] One of the following conditions is true:
The value of the size parameter is less than the system-defined minimum
or greater than the system-defined maximum.
A shared memory identifier already exists for the key parameter, but the
number of bytes allocated for the region is less than size and size is not
equal to 0 (zero).
[ENOENT] A shared memory identifier does not exist for the key parameter, and
IPC_CREAT was not set in the shmflag parameter.
[ENOMEM] An attempt was made to create a shared memory identifier and its associated
shared memory table entry, but there was not enough physical or virtual memory
available.
[ENOSPC] An attempt to create a new shared memory identifier exceeded the system limit
on the maximum number of identifiers allowed.
[ENOTOSS] The calling process is not an OSS process. The requested operation cannot be
performed from the Guardian environment on servers running J06.11 or earlier
J-series RVUs, H06.22 or earlier H-series RVUs, or G-series RVUs.
788 Hewlett-Packard Company 527186-023