Skip to content

[libc] implement sys/uio/readv #124694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SchrodingerZhu opened this issue Jan 28, 2025 · 1 comment · Fixed by #124718
Closed

[libc] implement sys/uio/readv #124694

SchrodingerZhu opened this issue Jan 28, 2025 · 1 comment · Fixed by #124718
Assignees
Labels

Comments

@SchrodingerZhu
Copy link
Contributor

SchrodingerZhu commented Jan 28, 2025

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}.
@llvmbot llvmbot added the libc label Jan 28, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 28, 2025

@llvm/issue-subscribers-libc

Author: Schrodinger ZHU Yifan (SchrodingerZhu)

We have added [writev](https://github.com//pull/122233), `readv` is still missing in `uio`.
NAME

    readv — read a vector

SYNOPSIS

    [[XSI](javascript:open_code('XSI'))] [Option Start] #include &lt;[sys/uio.h](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_uio.h.html)&gt;

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

@c8ef c8ef closed this as completed in e1c63bb Feb 6, 2025
Icohedron pushed a commit to Icohedron/llvm-project that referenced this issue Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants