int shmget(key_t key, size_t size, int shmflg);
Upon creation, the internal attributes associated with the new shared memory identifier are initialized as follows:
- shm_perm.cuid, shm_perm.uid, shm_perm.cgid, and shm_perm.gid are set to the effective user ID and effective group ID, respectively, of the calling process.
- The access permission bits of shm_perm.mode are set to the access permission bits of shmflg. shm_segsz is set to the value of size.
- shm_lpid, shm_nattach, shm_atime, and shm_dtime are set to zero.
- shm_ctime is set to the current time.
You must explicitly remove shared memory segments after the last reference to them has been removed.
Specifies either IPC_PRIVATE or a unique key.
Is the size in bytes of the shared memory segment.
Specifies both the creation and permission bits (for example, IPC_CREAT | 0666).
A shared memory identifier exists for key but operation permission as specified by the permission bits of shmflg would not be granted.
A shared memory identifier exists for key, but both (shmflg&IPC_CREAT) and (shmflg&IPC_EXCL) are non-zero.
A shared memory identifier exists for key, but the size of the segment associated with it is less than size and size is not equal to zero.
size is less than the system-imposed minimum or greater than the system-imposed maximum.
A shared memory identifier does not exist for key and (shmflg&IPC_CREAT) is zero.
A shared memory identifier and associated shared memory segment are to be created, but the amount of available memory is not sufficient to fulfill the request.
A shared memory identifier is to be created, but the system-imposed limit on the maximum number of allowed shared memory identifiers system wide would be exceeded.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.3 Documentation Build 39.