The shmget() function returns the shared memory identifier associated with the key. A shared memory identifier with its associated shmid_ds data structure is created for a key if one of the following is TRUE: o The key argument is equal to IPC_PRIVATE. o The key argument does not already have a shared memory identifier associated with it and (shmflg and IPC_CREAT) is non-zero. If shmflg specifies both IPC_CREAT and IPC_EXCL and a shared memory segment already exists for a key, shmget() function fails with errno set to EEXIST. When it is created, the shmid_ds data structure associated with the new shared memory identifier is initialized as follows: o The values of shm_perm.cuid, shm_perm.uid, shm_perm.cgid, and shm_perm.gid are set equal to the effective user ID and effective group ID, respectively, of the calling process. o The low order 9 bits of shm_perm.mode are set equal to the low order 9 bits of the shmflg argument. o The variable shm_segsz is set equal to the value of the size argument. o The variables shm_lpid, shm_nattch, shm_atime, and shm_dtime are set equal to zero, the variable shm_cpid is set equal to the Process ID of the segment creator, and the variable shm_ctime is set equal to the current time.