ark::pipe_fd class

wraps fildes created by pipe2(2) as an io object

Base classes

class nonseekable_fd
An io object, denotes a non lseek()-able fd as defined in kernel.

Public static functions

static auto create() -> result<pair<pipe_fd, pipe_fd>> noexcept
construct a std::pair of pipe_fd just like calling pipe2(2)
static auto create(async_context& ctx) -> result<pair<pipe_fd, pipe_fd>> noexcept
construct a std::pair of pipe_fd just like calling pipe2(2), and bind both of them to the given ark::async_context

Constructors, destructors, conversion operators

pipe_fd(int fd_int) protected
constructs from int fildes

Function documentation

static result<pair<pipe_fd, pipe_fd>> ark::pipe_fd::create() noexcept

construct a std::pair of pipe_fd just like calling pipe2(2)

on success, returns the {in, out} end of the pipe as a pair

static result<pair<pipe_fd, pipe_fd>> ark::pipe_fd::create(async_context& ctx) noexcept

construct a std::pair of pipe_fd just like calling pipe2(2), and bind both of them to the given ark::async_context

on success, returns the {in, out} end of the pipe as a pair

ark::pipe_fd::pipe_fd(int fd_int) protected

constructs from int fildes

Parameters
fd_int in must be an fildes opened by pipe2(2)