Pipes
SPDX-License-Identifier: Apache-2.0
The Zephyr RTOS shall provide a mechanism to define and initialize a pipe at compile time.
The Zephyr RTOS shall provide a mechanism to initialize a pipe at run time using a caller-provided buffer.
The Zephyr RTOS shall provide a mechanism for a thread to write up to a requested number of bytes into a pipe.
The Zephyr RTOS shall provide a mechanism for a thread to read up to a requested number of bytes from a pipe.
When writing to a pipe, the Zephyr RTOS shall accept a timeout that specifies the maximum time to wait for space to become available.
When writing to a pipe, if no data can be written within the specified maximum time, the Zephyr RTOS shall return an error indicating that no data was written.
When reading from a pipe, the Zephyr RTOS shall accept a timeout that specifies the maximum time to wait for data to become available.
When reading from a pipe, if no data becomes available within the specified maximum time, the Zephyr RTOS shall return an error indicating that no data was read.
The Zephyr RTOS shall provide a mechanism to reset a pipe, discarding any unread data and unblocking threads waiting on the pipe.
The Zephyr RTOS shall provide a mechanism to close a pipe, unblocking threads waiting on the pipe.
When a read or write operation is attempted on a closed pipe, the Zephyr RTOS shall return an error indicating that the pipe is closed.
When a read or write operation is interrupted by a pipe reset, the Zephyr RTOS shall return an error indicating that the operation was cancelled.