Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
writev(2)
Edit
PageHistory
Diff
Info
LikePages
!!NAME readv, writev - read or write a vector !!SYNOPSIS __#include <sys/uio.h>__ __int readv(int__ ''fd''__, const struct iovec *__ ''vector''__, int__ ''count''__);__ __int writev(int__ ''fd''__, const struct iovec *__ ''vector''__, int__ ''count''__);__ __struct iovec { __ptr_t__ ''iov_base''__;__ /* Starting address. */__ __size_t__ ''iov_len''__;__ /* Length in bytes. */__ };__ !!DESCRIPTION __readv__ reads data from file descriptor ''fd'', and puts the result in the buffers described by ''vector''. The number of buffers is specified by ''count''. The buffers are filled in the order specified. Operates just like __read__ except that data is put in ''vector'' instead of a contiguous buffer. __writev__ writes data to file descriptor ''fd'', and from the buffers described by ''vector''. The number of buffers is specified by ''count''. The buffers are used in the order specified. Operates just like __write__ except that data is taken from ''vector'' instead of a contiguous buffer. !!RETURN VALUE On success __readv__ returns the number of bytes read. On success __writev__ returns the number of bytes written. On error, -1 is returned, and ''errno'' is set appropriately. !!ERRORS ;[EINVAL]: An invalid argument was given. For instance ''count'' might be greater than __MAX_IOVEC__, or zero. ''fd'' could also be attached to an object which is unsuitable for reading (for __readv__) or writing (for __writev__). ;[EFAULT]: vector'' or some of the ''iov_base'' pointers points to memory that is not properly allocated. ;[EBADF]: The file descriptor ''fd'' is not valid. ;[EINTR]: The call was interrupted by a signal before any data was read/written. ;[EAGAIN]: Non-blocking I/O has been selected using __O_NONBLOCK__ and no data was immediately available for reading. (Or the file descriptor ''fd'' is for an object that is locked.) ;[EISDIR]: ''fd'' refers to a directory. ;[EOPNOTSUP]: ''fd'' refers to a socket or device that does not support reading/writing. ;[ENOMEM]: Insufficient kernel memory was available. Other errors may occur, depending on the object connected to ''fd''. !!CONFORMING TO 4.4BSD (the __readv__ and __writev__ functions first appeared in BSD 4.2), Unix98. Linux libc5 uses __size_t__ as the type of the ''count'' parameter, which is logical but non-standard. !!SEE ALSO read(2), write(2), fprintf(3), fscanf(3)
3 pages link to
writev(2)
:
Man2w
socket(7)
syscalls(2)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.