#include <sys/types.h> #include <sys/uio.h> int readv(int descriptor, struct iovec *io_vector[], int vector_length)Service Program Name: QP0LLIB1
The readv() function is used to receive data from a file or socket descriptor. readv() provides a way for data to be stored in several different buffers (scatter/gather I/O).
See read()--Read from Descriptor for more information related to reading from a descriptor.
struct iovec { void *iov_base; size_t iov_len; }
iov_base and iov_len are the only fields in iovec used by sockets. iov_base contains the pointer to a buffer and iov_len contains the buffer length. The rest of the fields are reserved.
No authorization is required.
If readv() is not successful, errno usually indicates one of the following errors. Under some conditions, errno could indicate an error other than those listed here.
Error condition | Additional information |
---|---|
[EACCES] |
If you are accessing a remote file through the Network File System, update operations to file permissions at the server are not reflected at the client until updates to data that is stored locally by the Network File System take place. (Several options on the Add Mounted File System (ADDMFS) command determine the time between refresh operations of local data.) Access to a remote file may also fail due to different mappings of user IDs (UID) or group IDs (GID) on the local and remote systems. This may occur if file_descriptor refers to a socket and the socket is using a connection-oriented transport service, and a connect() was previously completed. The thread, however, does not have the appropriate privileges to the objects that were needed to establish a connection. For example, the connect() required the use of an APPC device that the thread was not authorized to. |
[EAGAIN] | |
[EBADF] | |
[EBADFID] | |
[EBUSY] | |
[EDAMAGE] | |
[EFAULT] | |
[EINTR] | |
[EINVAL] |
This may occur if file_descriptor refers to a socket that is using a connectionless transport service, is not a socket of type SOCK_RAW, and is not bound to an address. The file resides in a file system that does not support large files, and the starting offset of the file exceeds 2 GB minus 2 bytes. |
[EIO] | |
[ENOMEM] | |
[ENOTAVAIL] | |
[ENOTSAFE] | |
[EOVERFLOW] |
The file is a regular file, nbyte is greater than 0, the starting offset is before the end-of-file and is greater than or equal to 2GB minus 2 bytes. |
[ERESTART] | |
[ESTALE] |
If you are accessing a remote file through the Network File System, the file may have been deleted at the server. |
[EUNKNOWN] |
When the descriptor refers to a socket, errno could indicate one of the following errors:
Error condition | Additional information |
---|---|
[ECONNABORTED] |
This error code indicates that the transport provider ended the connection abnormally because of one of the following:
|
[ECONNREFUSED] | |
[ECONNRESET] | |
[EINTR] | |
[ENOTCONN] | |
[ETIMEDOUT] |
A non-blocking connect() was previously completed that resulted in the connection timing out. No connection is established. This error code is returned only on sockets that use a connection-oriented transport service. |
[EUNATCH] | |
[EWOULDBLOCK] |
If interaction with a file server is required to access the object, errno could indicate one of the following errors:
Error condition | Additional information |
---|---|
[EADDRNOTAVAIL] | |
[ECONNABORTED] | |
[ECONNREFUSED] | |
[ECONNRESET] | |
[EHOSTDOWN] | |
[EHOSTUNREACH] | |
[ENETDOWN] | |
[ENETRESET] | |
[ENETUNREACH] | |
[ESTALE] |
If you are accessing a remote file through the Network File System, the file may have been deleted at the server. |
[ETIMEDOUT] | |
[EUNATCH] |
Message ID | Error Message Text |
---|---|
CPE3418 E | Possible APAR condition or hardware failure. |
CPF3CF2 E | Error(s) occurred during running of &1 API. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
CPFA081 E | Unable to set return value or error code. |
CPFA0D4 E | File system error occurred. Error number &1. |
The largest buffer size allowed is 16 megabytes. If a larger buffer is passed, the error EINVAL will be received.
When reading from files on volumes formatted in Universal Disk Format (UDF), byte locks on the range being read are ignored.
Top | UNIX-Type APIs | APIs by category |