<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/124694>124694</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc] implement sys/uio/readv
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SchrodingerZhu
</td>
</tr>
</table>
<pre>
We have added [writev](https://github.com/llvm/llvm-project/pull/122233), `readv` is still missing in `uio`.
```
NAME
readv — read a vector
SYNOPSIS
[[XSI](javascript:open_code('XSI'))] [Option Start] #include <[sys/uio.h](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_uio.h.html)>
ssize_t readv(int fildes, const struct iovec *iov, int iovcnt); [Option End]
DESCRIPTION
The readv() function shall be equivalent to [read()](https://pubs.opengroup.org/onlinepubs/9799919799/functions/read.html), except as described below. The readv() function shall place the input data into the iovcnt buffers specified by the members of the iov array: iov[0], iov[1], ..., iov[iovcnt-1]. The iovcnt argument is valid if greater than 0 and less than or equal to {IOV_MAX}.
Each iovec entry specifies the base address and length of an area in memory where data should be placed. The readv() function shall always fill an area completely before proceeding to the next.
Upon successful completion, readv() shall mark for update the last data access timestamp of the file.
RETURN VALUE
Refer to [read()](https://pubs.opengroup.org/onlinepubs/9799919799/functions/read.html#tag_17_476).
ERRORS
Refer to [read()](https://pubs.opengroup.org/onlinepubs/9799919799/functions/read.html#tag_17_476).
In addition, the readv() function shall fail if:
[EINVAL]
The sum of the iov_len values in the iov array overflowed an ssize_t.
The readv() function may fail if:
[EINVAL]
The iovcnt argument was less than or equal to 0, or greater than {IOV_MAX}.
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMVl9v2zYQ_zT0y6GCRNmW9eAHO7EBA21S2G3W7cWgqJPFjiI1klLqffrhJDtx968rMAwLhBjkkb-7-90fnvBenQziks3WbHY_EV2orVseZO1sqcwJ3U91NylseV7-gF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