The readv callable service reads data and stores it in a set of buffers.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task SRB - AF_INET/AF_INET6 socket support only |
Cross memory mode: | PASN = HASN |
AMODE (BPX1RDV): | 31-bit task or SRB mode |
AMODE (BPX4RDV): | 64-bit task mode only |
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 BPX4RDV with the same parameters. All addresses in parameter structures are doublewords.
The name of a fullword that contains the file descriptor for which the readv request is to be done.
The name of a field that contains the number of buffers that are pointed to by Iov_struct. The total number of buffers may not exceed IOV_MAX (defined in BPXYIOV — Map the I/O vector structure).
The name of a field that contains 31(64)-bit pointers to buffers in which data is to be stored, and their lengths. In 64-bit mode, Iov_struct contains doubleword pointer and length subfields. See BPXYIOV — Map the I/O vector structure for more information.
The name of a field that contains the ALET for Iov_struct.
The name of a field that contains the ALET for buffers that are pointed to by Iov_struct.
Return_code | Explanation |
---|---|
EAGAIN | The file was opened with the nonblock option, and data is not available to be read. |
EBADF | An incorrect file descriptor was specified. The following reason codes can accompany the return code: JRFileDesNotInUse, JRFileNotOpen. |
EINTR | A signal interrupted the readv function before any data was available. The following reason code can accompany the return code: JRSockRdwrSignal. |
EINVAL | The socket is marked shutdown for read; or an incorrect length was specified in the iov. The following reason codes can accompany the return code: JRSocketClosed, JRSocketCallParmError. |
EIO | The process is in a background process group, and is attempting to read from its controlling terminal. However, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU signals, and the process group of the process is orphaned. This can happen, for example, if a background job tries to write to the terminal after the user has logged off. |
ENOBUFS | A buffer could not be obtained. The following reason code can accompany the return code: JROutofSocketCells. |
EWOULDBLOCK |
The following reason code can accompany the return code: JRTimeout. |
The name of a fullword in which the readv service stores the reason code. The readv service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
For files where no seek operation is possible, there is no file offset associated with the file descriptor. Reading begins at the current position in the file.
Master and slave pseudoterminals also operate this way, except that how they act depends on how they were opened. If the master or the slave is opened blocking, the reads are blocked if there is no data. If they are opened nonblocking, EAGAIN is returned if there is no data.
There are no restrictions on the use of the readv service.
For an example using this callable service, see BPX1RDV (readv) example.