long define_syscall pipe(fd_t *reader, fd_t *writer, fd_flags_t flags)
__nodiscard bool pipe_close_one_end(pipe_t *pipe)
Close one end of the pipe, so that the other end will get EOF.
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)
pipe_t * pipe_create(size_t bufsize)
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