BPX4GRU (getrusage) example

The following code fills in the rusage structure based on the input who value. The who value is set to RUSAGE_SELF. For the callable service, see getrusage (BPX1GRU, BPX4GRU) — Get resource usage. For the data structure, see BPXYRLIM — Map the rlimit, rusage, and timeval structures. AMODE 31 callers use BPX1GRU (getrusage) example.
                                              
         MVC   WHO,=A(RUSAGE_SELF)   Value of who                       
         SPACE ,                                                        
         CALL  BPX4GRU,              Get resource usage                +
               (WHO,                 Input: who                        +
               RUSAGE,               Structure, mapped by BPXYRLIM     +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ---------------------------------- 
         L     R15,RETVAL            Load return value                  
         C     R15,=F'-1'            Test for -1 return                 
         BE    PSEUDO                Branch on error