|
|
1.1 ! root 1: ! 2: ! 3: semctl() COHERENT System Call semctl() ! 4: ! 5: ! 6: ! 7: ! 8: Control semaphore operations ! 9: ! 10: #include <sys/sem.h> ! 11: sseemmccttll(_s_e_m_i_d, _s_e_m_n_u_m, _c_m_d, _a_r_g) ! 12: iinntt _s_e_m_i_d, _c_m_d, _s_e_m_n_u_m; ! 13: uunniioonn sseemmuunn { ! 14: iinntt _v_a_l; ! 15: ssttrruucctt sseemmiidd_ddss *_b_u_f; ! 16: uunnssiiggnneedd sshhoorrtt _a_r_r_a_y[]; ! 17: } _a_r_g; ! 18: ! 19: semctl controls a variety of semaphore operations. cmd sets the ! 20: operation to be performed; the following cmds are executed with ! 21: respect to the semaphore specified by semid and semnum: ! 22: ! 23: GGEETTVVAALL ! 24: Return the value of sseemmvvaall (READ). ! 25: ! 26: SSEETTVVAALL ! 27: Set the value of sseemmvvaall to _a_r_g._v_a_l (ALTER). ! 28: ! 29: GGEETTPPIIDD ! 30: Return the value of sseemmppiidd (READ). ! 31: ! 32: GGEETTNNCCNNTT ! 33: Return the value of sseemmnnccnntt (READ). ! 34: ! 35: GGEETTZZCCNNTT ! 36: Return the value of sseemmzzccnntt (READ). ! 37: ! 38: The following cmds return and set, respectively, every semval in ! 39: the set of semaphores. ! 40: ! 41: GGEETTAALLLL Place semvals into array pointed to by _a_r_g._a_r_r_a_y ! 42: (READ). ! 43: ! 44: SSEETTAALLLL Set semvals according to the array pointed to by ! 45: _a_r_g._a_r_r_a_y (ALTER). ! 46: ! 47: The following cmds are also available: ! 48: ! 49: IIPPCC_SSTTAATT Place the current value of each member of the data ! 50: structure associated with semid into the structure ! 51: pointed to by _a_r_g._b_u_f (READ). ! 52: ! 53: IIPPCC_SSEETT Set the value of the following members of the data ! 54: structure associated with semid to the corresponding ! 55: value found in the structure pointed to by arg.buf: ! 56: ! 57: sem_perm.uid ! 58: sem_perm.gid ! 59: sem_perm.mode /* only low 9 bits */ ! 60: ! 61: This command can only be executed by a process that has ! 62: ! 63: ! 64: COHERENT Lexicon Page 1 ! 65: ! 66: ! 67: ! 68: ! 69: semctl() COHERENT System Call semctl() ! 70: ! 71: ! 72: ! 73: an effective user identifier equal to either that of ! 74: superuser or to the value of sem_perm.uid in the data ! 75: structure associated with semid. ! 76: ! 77: IIPPCC_RRMMIIDD Remove the system identifier specified by semid from ! 78: the system and destroy the set of semaphores and data ! 79: structure associated with it. This cmd can only be ex- ! 80: ecuted by a process that has an effective user iden- ! 81: tifier equal to either that of super user or to the ! 82: value of sem_perm.uid in the data structure associated ! 83: with semid. ! 84: ! 85: semctl will fail if one or more of the following are true: ! 86: ! 87: * semid is not a valid semaphore identifier [EINVAL]. ! 88: ! 89: * semnum is less than zero or greater than sem_nsems [EINVAL]. ! 90: ! 91: * cmd is not a valid command [EINVAL]. ! 92: ! 93: * Operation permission is denied to the calling process. ! 94: [EACCES] ! 95: ! 96: * cmd is SETVAL or SETALL and the value to which semval is to be ! 97: set is greater than the system imposed maximum [ERANGE]. ! 98: ! 99: * cmd is equal to IPC_RMID or IPC_SET and the effective user ! 100: identifier of the calling process is not equal to that of su- ! 101: peruser and it is not equal to the value of sem_perm.uid in ! 102: the data structure associated with semid [EPERM]. ! 103: ! 104: * arg.buf points to an illegal address [EFAULT]. ! 105: ! 106: ***** Return Value ***** ! 107: ! 108: Upon successful completion, the value returned depends on cmd as ! 109: follows: ! 110: ! 111: ! 112: GGEETTVVAALL The value of sseemmvvaall. ! 113: GGEETTPPIIDD The value of sseemmppiidd. ! 114: GGEETTNNCCNNTT The value of sseemmnnccnntt. ! 115: GGEETTZZCCNNTT The value of sseemmzzccnntt. ! 116: All othersZero ! 117: ! 118: ! 119: Otherwise, semctl returns -1 and sets eerrrrnnoo to an appropriate ! 120: value. ! 121: ! 122: ***** Files ***** ! 123: ! 124: /usr/include/sys/ipc.h ! 125: /usr/include/sys/sem.h ! 126: /dev/sem ! 127: /drv/sem ! 128: ! 129: ! 130: COHERENT Lexicon Page 2 ! 131: ! 132: ! 133: ! 134: ! 135: semctl() COHERENT System Call semctl() ! 136: ! 137: ! 138: ! 139: ! 140: ***** See Also ***** ! 141: ! 142: COHERENT system calls, sem, semget(), semop() ! 143: ! 144: ***** Notes ***** ! 145: ! 146: To improve portability, the COHERENT system implements the ! 147: semaphore functions as a device driver rather than as an actual ! 148: system call. ! 149: ! 150: ! 151: ! 152: ! 153: ! 154: ! 155: ! 156: ! 157: ! 158: ! 159: ! 160: ! 161: ! 162: ! 163: ! 164: ! 165: ! 166: ! 167: ! 168: ! 169: ! 170: ! 171: ! 172: ! 173: ! 174: ! 175: ! 176: ! 177: ! 178: ! 179: ! 180: ! 181: ! 182: ! 183: ! 184: ! 185: ! 186: ! 187: ! 188: ! 189: ! 190: ! 191: ! 192: ! 193: ! 194: ! 195: ! 196: COHERENT Lexicon Page 3 ! 197: ! 198:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.