- 论坛徽章:
- 0
|
RETURN VALUES
Upon successful completion, a shared memory identifier is returned. If the
shmget() function fails, a value of -1 is returned and errno is set to
indicate the error.
ERRORS
The shmget() function sets errno to the specified values for the following
conditions:
[EACCES]
A shared memory region ID already exists for the key parameter, but
operation permission as specified by the low-order nine bits of the
flags parameter was not granted.
[EEXIST]
A shared memory region ID already exists for the key parameter, but
IPC_CREAT and IPC_EXCL were specified for the flags parameter.
[EINVAL]
The value of the size parameter is less than the system-defined minimum
or greater than the system-defined maximum. Or, a shared memory region
ID already exists for the key parameter, but the number of bytes allo-
cated for the region is less than size and size is not equal to 0
(zero).
[ENOENT]
A shared memory region ID does not exist for the key parameter, and
IPC_CREAT was not used for the flags parameter.
[ENOMEM]
An attempt was made to create a shared memory region ID and its associ-
ated shmid_ds structure, but there was not enough physical memory
available.
[ENOSPC]
An attempt to create a new shared memory region ID exceeded the
system-wide limit on the maximum number of IDs allowed.
检查一下 |
|