The semop service performs a group of semaphore operations atomically.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1SOP): | 31-bit |
AMODE (BPX4SOP): | 64-bit |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
|
AMODE 64 callers use BPX4SOP with the same parameters. The Semaphore_Operations parameter is a doubleword.
Specifies the semaphore identifier.
Contains the number of operations in Semaphore_Operations. A value of zero up to the maximum allowed by the system may be specified.
The name of a fullword in which the semop service returns 0 (all SEM_OP operations were performed) or -1 (none of the SEM_OP operations were performed).
Return_code | Explanation |
---|---|
EACCES | Permission is denied. The following reason code can accompany the return code: JRIpcDenied. |
EAGAIN | The operation would result in suspension of the calling process, but NOWAIT (see SEM_FLGS) was specified. The following reason code can accompany the return code: JRIpcRetry. |
EDEADLK | The combination of operations can never be satisfied. This condition is detected by analysis of the operations that were requested and the system maximums, and does not include interactions with other threads. For example, an operation could add 1 to a semaphore, and a later operation in the same SEM_BUF could test it for zero. The following reason code can accompany the return code: JRDeadlock. |
EFAULT | The Semaphore_Operations parameter specified an address that caused the service to program check. The following reason code can accompany the return code: JRBadAddress. |
EFBIG | SEM_NUM is less than zero or is greater than or equal to the number of semaphores in the set specified by the Number_of_Semaphores parameter of the semget() call. The following reason code can accompany the return code: JRSema4BadSemN. |
EIDRM | Semaphore_ID was removed from the system while the caller was waiting. The following reason code can accompany the return code: JRIpcRemoved. |
EINTR | semop() was interrupted by a signal. The following reason code can accompany the return code: JRIpcSignaled. |
EINVAL | The Semaphore_ID does not represent a semaphore set. The following reason code can accompany the return code: JRIpcBadID. |
ENOSPC | The space that is allotted for all semaphore data would be exceeded by the addition of the UNDO structure for this request. The following reason code can accompany the return code: JRSemStorageLimit. |
ERANGE | An operation would cause sem_val or sem_adj to overflow the system-imposed limit. These system limits are defined in BPXYSEM fields SEM#MAX_VAL and SEM#MAX_ADJ. The following reason codes can accompany the return code: JRSema4BadValue and JRSema4BadAdj. |
E2BIG | Number_of_Semaphore_Operations exceeds the maximum allowed by the system. This system limit is set with the IPCSEMNOPS parameter in a BPXPRMxx parmlib member. You can use the ipcs -x shell command to view this value. The following reason code can accompany the return code: JRSema4BadNOps. |
The name of a fullword in which the semop service stores the reason code. The semop service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. See z/OS UNIX System Services Messages and Codes for the reason codes.
The invoker is restricted by ownership, read, and read-write permissions that are defined by semget and semctl Ipc_SET.
For an example using this callable service, see BPX1SOP (semop) example.