io_uring_prep_pipe(3) — Linux manual page

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | SEE ALSO | COLOPHON

io_uring_prep_pipe(3)        liburing Manual        io_uring_prep_pipe(3)

NAME         top

       io_uring_prep_pipe - prepare a pipe creation request

SYNOPSIS         top

       #include <liburing.h>

       void io_uring_prep_pipe(struct io_uring_sqe *sqe,
                               int *fds,
                               int pipe_flags);

       void io_uring_prep_pipe_direct(struct io_uring_sqe *sqe,
                                      int *fds,
                                      int pipe_flags,
                                      unsigned int file_index);

DESCRIPTION         top

       The io_uring_prep_pipe(3) function prepares a pipe creation
       request. The submission queue entry sqe is setup to create a pipe
       with the created descriptors being copied to the array indicated
       by fds and using pipe_flags as the pipe creation flags. See
       pipe2(2) for details on the flags accepted.

       The io_uring_prep_pipe_direct(3) function works in the same way,
       however it uses fixed/registered file descriptors rather than
       normal file descriptors. This helper takes an additional
       file_index argument, which can set to either an explicit direct
       descriptor offset to create the two pipe file descriptors at, or
       it can be set to IORING_FILE_INDEX_ALLOC to let io_uring pick any
       available descriptors for the read and write side of the pipe. If
       a specific index is given, the read side of the pipe will be
       created at that offset, if free, and the write side will be
       created at the next (+1) index. Both of these must be currently
       unused, or the operation will fail. Also see
       io_uring_prep_accept_direct(3) or io_uring_prep_socket_direct(3)
       for details on the file_index parameter.

       For both the direct and normal file descriptor pipe request, the
       resulting input/read side of the pipe will be stored in fds[0] and
       the output/write side of the pipe will be stored in fds[1] upon
       successful completion of this request.

       This function prepares an async pipe2(2) request. See that man
       page for details.

RETURN VALUE         top

       None

ERRORS         top

       The CQE res field will contain the result of the operation. See
       the related man page for details on possible values. Note that
       where synchronous system calls will return -1 on failure and set
       errno to the actual error value, io_uring never uses errno.
       Instead it returns the negated errno directly in the CQE res
       field.

SEE ALSO         top

       io_uring_get_sqe(3), io_uring_submit(3), pipe2(2),
       io_uring_prep_accept_direct(3), io_uring_prep_socket_direct(3)

COLOPHON         top

       This page is part of the liburing (A library for io_uring)
       project.  Information about the project can be found at 
       ⟨https://github.com/axboe/liburing⟩.  If you have a bug report for
       this manual page, send it to [email protected].  This page
       was obtained from the project's upstream Git repository
       ⟨https://github.com/axboe/liburing⟩ on 2025-08-11.  (At that time,
       the date of the most recent commit that was found in the
       repository was 2025-08-02.)  If you discover any rendering
       problems in this HTML version of the page, or you believe there is
       a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to
       [email protected]

liburing-2.10                 April 8, 2025         io_uring_prep_pipe(3)

Pages that refer to this page: io_uring_prep_pipe(3)