Skip to content

[libc] implement sys/uio/readv #124694

@SchrodingerZhu

Description

@SchrodingerZhu

We have added writev, readv is still missing in uio.

see https://pubs.opengroup.org/onlinepubs/9799919799/functions/readv.html

NAME

readv — read a vector

SYNOPSIS

[XSI] [Option Start] #include <sys/uio.h>

ssize_t readv(int fildes, const struct iovec *iov, int iovcnt); [Option End]

DESCRIPTION

The readv() function shall be equivalent to read(), 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().

ERRORS

Refer to read().

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}.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions