Syntax | #include <sys/shm.h> int shmget(key_t key, int size, int shmflg); | |
Description |
A shared memory identifier, associated data structure and shared memory segment of at least size bytes (see
Upon creation, the data structure associated with the new shared memory identifier is initialized as follows:
| |
Return val. | Shared memory identifier | |
if successful. The shared memory ID is a non-negative integer. | ||
-1 | if an error occurs. | |
Errors |
| |
| A shared memory ID for the argument key exists, but the permissions specified in the 9 low-order bits of shmflg were not granted. | |
|
| A shared memory ID exists for the argument key, but ((shmflg |
|
| The value of size is less than the system-imposed minimum or greater than the system-imposed maximum, or a shared memory identifier exists for the argument key, but the size of the segment associated with it is less than size and size is not 0. |
|
| A shared memory identifier does not exist for key and (shmflg |
| The amount of available physical memory is not sufficient to fill the request. | |
| The system-imposed limit on the maximum number of allowed shared memory IDs would be exceeded. | |
Note | BS2000 | |
See also |
|