|
|
1.1 ! root 1: ! 2: ! 3: shmget() COHERENT System Call shmget() ! 4: ! 5: ! 6: ! 7: ! 8: Get shared-memory segment ! 9: ! 10: #include <sys/shm.h> ! 11: sshhmmggeett(_k_e_y, _s_i_z_e, _s_h_m_f_l_g) ! 12: kkeeyy_tt _k_e_y; iinntt _s_i_z_e, _s_h_m_f_l_g; ! 13: ! 14: shmget returns the shared-memory identifier associated with key. ! 15: ! 16: A shared-memory identifier and associated data structure and ! 17: shared memory segment of size size bytes is created for key if ! 18: key does not already have a shared-memory identifier associated ! 19: with it, and (_s_h_m_f_l_g & IIPPCC_CCRREEAATT) is true. ! 20: ! 21: Upon creation, the data structure associated with the new shared ! 22: memory identifier is initialized as follows: ! 23: ! 24: * shm_perm.cuid, shm_perm.uid, shm_perm.cgid, and shm_perm.gid ! 25: are set equal to the effective user ID and effective group ID, ! 26: respectively, of the calling process. ! 27: ! 28: * The low-order nine bits of shm_perm.mode are set equal to the ! 29: low-order nine bits of shmflg. These nine bits define access ! 30: permissions: the top three bits give the owner's access per- ! 31: missions (read, write, execute), the middle three bits the ! 32: owning group's access permissions, and the low three bits ac- ! 33: cess permissions for others. ! 34: ! 35: * shm_segsz is set equal to the value of size. ! 36: ! 37: * shm_lpid, shm_nattch, shm_atime, and shm_dtime are set equal ! 38: to zero. shm_ctime is set equal to the current time. ! 39: ! 40: shmget fails if any of the following is true: ! 41: ! 42: * size is less than the system-imposed minimum or greater than ! 43: the system-imposed maximum. shmget sets errno to EINVAL. ! 44: ! 45: * A shared-memory identifier exists for key but operation per- ! 46: mission as specified by the low-order nine bits of shmflg ! 47: would not be granted (EEAACCCCEESS). ! 48: ! 49: * A shared-memory identifier exists for key but the size of the ! 50: segment associated with it is less than size and size is not ! 51: equal to zero (EEIINNVVAALL). ! 52: ! 53: * A shared-memory identifier does not exist for key and (_s_h_m_f_l_g ! 54: & IIPPCC_CCRREEAATT) is false (EENNOOEENNTT). ! 55: ! 56: * A shared-memory identifier is to be created but the system-im- ! 57: posed limit on the maximum number of allowed shared memory ! 58: identifiers system-wide would be exceeded (EENNOOSSPPCC). ! 59: ! 60: * A shared-memory identifier and associated shared-memory seg- ! 61: ment are to be created, but the amount of available physical ! 62: ! 63: ! 64: COHERENT Lexicon Page 1 ! 65: ! 66: ! 67: ! 68: ! 69: shmget() COHERENT System Call shmget() ! 70: ! 71: ! 72: ! 73: memory is not sufficient to fill the request (EENNOOMMEEMM). ! 74: ! 75: * A shared-memory identifier exists for key but ( (_s_h_m_f_l_g & ! 76: IIPPCC_CCRREEAATT) && (_s_h_m_f_l_g & IIPPCC_EEXXCCLL) ) is true (EEEEXXIISSTT). ! 77: ! 78: ***** Return Value ***** ! 79: ! 80: Upon successful completion, shmget returns a shared-memory iden- ! 81: tifier, which is always a non-negative integer. Otherwise, it ! 82: returns -1 and sets eerrrrnnoo to an appropriate value. ! 83: ! 84: ***** Files ***** ! 85: ! 86: /usr/include/sys/ipc.h ! 87: /usr/include/sys/shm.h ! 88: /dev/shm ! 89: /drv/shm ! 90: ! 91: ***** See Also ***** ! 92: ! 93: COHERENT system calls, shm, shmctl() ! 94: ! 95: ***** Notes ***** ! 96: ! 97: To improve portability, the COHERENT system implements its ! 98: shared-memory functions as a device driver rather than actual ! 99: system calls. ! 100: ! 101: ! 102: ! 103: ! 104: ! 105: ! 106: ! 107: ! 108: ! 109: ! 110: ! 111: ! 112: ! 113: ! 114: ! 115: ! 116: ! 117: ! 118: ! 119: ! 120: ! 121: ! 122: ! 123: ! 124: ! 125: ! 126: ! 127: ! 128: ! 129: ! 130: COHERENT Lexicon Page 2 ! 131: ! 132:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.