long define_syscall pipe(fd_t *reader, fd_t *writer, u64 flags)
__nodiscard bool pipe_close_one_end(pipe_t *pipe)
Close one end of the pipe, so that the other end will get EOF.
PtrResult< pipe_t > pipe_create(size_t bufsize)
pipeio_t * pipeio_create(pipe_t *pipe)
size_t pipe_write(pipe_t *pipe, const void *buf, size_t size)
size_t pipe_read(pipe_t *pipe, void *buf, size_t size)
IO(IOFlags flags, io_type_t type)
size_t on_write(const void *buf, size_t size) override
PipeIOImpl(IOFlags flags)
void on_closed() override
size_t on_read(void *buf, size_t size) override
bool other_closed
true if the other end of the pipe has been closed
ring_buffer_pos_t buffer_pos
spinlock_t lock
protects the buffer_pos (and thus the buffer)
waitlist_t waitlist
for both reader and writer, only one party can wait on the pipe at a time