BPX4MAT (shmat) example

The following code attaches a shared memory segment. For the callable service, see shmat (BPX1MAT, BPX4MAT) — Attach to a shared memory segment. For the data structure, see BPXYSHM—Map interprocess communication shared memory segments. AMODE 31 callers use BPX1MAT (shmat) example.
                                              
         CALL  BPX4MAT,              Shared memory segment control     +
               (SHM_ID,              Input: Shared memory segment ID   +
               SEGADDR,              Input: ST loc for seg address     +
               =A(0),                Input: Flags              BPXYSHM +
               ATTADDR,              Output: memory segment address    +
               RETVAL,               Return value: 0, -1               +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ----------------------------------