Penguin
Annotated edit history of writev(2) version 3, including all changes. View license author blame.
Rev Author # Line
1 perry 1 !!NAME
2 readv, writev - read or write a vector
3 !!SYNOPSIS
2 PerryLorier 4 __#include <sys/uio.h>__
1 perry 5
2 PerryLorier 6 __int readv(int__ ''fd''__, const struct iovec *__ ''vector''__, int__ ''count''__);__
1 perry 7
2 PerryLorier 8 __int writev(int__ ''fd''__, const struct iovec *__ ''vector''__, int__ ''count''__);__
1 perry 9
2 PerryLorier 10 __struct iovec {
11 __ptr_t__ ''iov_base''__;__ /* Starting address. */__
12 __size_t__ ''iov_len''__;__ /* Length in bytes. */__
13 };__
1 perry 14 !!DESCRIPTION
2 PerryLorier 15 __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
16 buffers are filled in the order specified. Operates just like __read__ except that data is put in ''vector'' instead of a contiguous buffer.
1 perry 17
3 PerryLorier 18 __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.
1 perry 19
20 !!RETURN VALUE
2 PerryLorier 21 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.
1 perry 22
23 !!ERRORS
2 PerryLorier 24 ;[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__).
25 ;[EFAULT]: vector'' or some of the ''iov_base'' pointers points to memory that is not properly allocated.
26 ;[EBADF]: The file descriptor ''fd'' is not valid.
27 ;[EINTR]: The call was interrupted by a signal before any data was read/written.
28 ;[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.)
29 ;[EISDIR]: ''fd'' refers to a directory.
30 ;[EOPNOTSUP]: ''fd'' refers to a socket or device that does not support reading/writing.
31 ;[ENOMEM]: Insufficient kernel memory was available.
1 perry 32
2 PerryLorier 33 Other errors may occur, depending on the object connected to ''fd''.
1 perry 34
35 !!CONFORMING TO
2 PerryLorier 36 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
37 but non-standard.
1 perry 38
39 !!SEE ALSO
2 PerryLorier 40 read(2), write(2), fprintf(3), fscanf(3)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 6 times)