BPX4RDV (readv) example

The following code issues a readv for a socket. SOCKDESC was returned previously from a call to either BPX4SOC or BPX4ACP. For the callable service, see readv (BPX1RDV, BPX4RDV) — Read data and store it in a set of buffers. For the data structures, see BPXYSOCK — Map SOCKADDR structure and constants and BPXYIOV — Map the I/O vector structure. AMODE 31 callers use BPX1RDV (readv) example.
                                              
        SPACE ,                                                         
         LA    R2,BUFFERA                                               
         STG   R2,IOV_BASE                                              
         LA    R2,L'BUFFERA                                             
         STG    R2,IOV_LEN                                              
         CALL  BPX4RDV,              Read into a vector of buffers     +
               (SOCKDESC,            Input: Socket Descriptor          +
               =A(1),                Input: Number of elements in iov  +
               IOV,                  Input: Iov containing info        +
               PRIMARYALET,          Input: Alet where iov resides     +
               PRIMARYALET,          Input: Alet of buffers for data   +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ----------------------------------