The following code retrieves the PID of the last process
to update semaphore 4 from the SEM_ID semaphore set. For the callable
service, see
semctl (BPX1SCT, BPX4SCT) — Perform semaphore control operations. For the data structure,
see
BPXYSEM — Map interprocess communication semaphores. AMODE 64 callers use
BPX4SCT (semctl) example.
LA R15,BUFFERA
ST R15,BUFA
MVC SEM_NUMBER(4),4 Semaphore number 4 in set
SPACE ,
CALL BPX1SCT, Semaphore control operations +
(SEM_ID, Input: Semaphore set ID +
SEM_NUMBER, Input: Semaphore number (0 based) +
=A(SEM_GETPID), Input: Action to take BPXYSEM +
BUFA, Input: Value | Buffer | Array | 0 +
RETVAL, Return value: 0, -1 or value +
RETCODE, Return code +
RSNCODE), Reason code +
VL,MF=(E,PLIST) ----------------------------------