|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Borrowed raw-descriptor backend for the portable byte-stream facade. More...
#include "ra8_io_stream.h"Go to the source code of this file.
Data Structures | |
| struct | ra8_io_stream_posix_state_t |
| Caller-owned state retained by one POSIX stream binding. More... | |
Functions | |
| ra8_err_t | ra8_io_stream_posix_init (ra8_io_stream_t *stream, ra8_io_stream_posix_state_t *state, int fd) |
| Bind a borrowed writable descriptor as a byte-stream sink. | |
Borrowed raw-descriptor backend for the portable byte-stream facade.
Binds a caller-owned ra8_io_stream_t to an already-open POSIX descriptor. Writes use the kernel descriptor API directly, so the adapter owns no FILE, C-runtime buffering, allocation, path, or descriptor lifetime. Composition may bind stdout, stderr, a pipe, or another blocking descriptor; the caller remains responsible for opening and closing it.
Definition in file ra8_io_stream_posix.h.
|
nodiscard |
Bind a borrowed writable descriptor as a byte-stream sink.
| [out] | stream | Stream handle to initialize. |
| [out] | state | Caller-owned adapter state retained by stream. |
| [in] | fd | Open writable descriptor borrowed for the binding lifetime. |
| k_ra8_ok | The stream is bound to fd. |
| k_ra8_err_null_ptr | A required pointer is null. |
| k_ra8_err_invalid_arg | fd is negative. |
fd remains open and writable until the last operation through stream has completed. stream and state while binding. stream and state. Definition at line 249 of file ra8_io_stream_posix.c.
References k_ra8_err_invalid_arg, k_ra8_err_null_ptr, k_ra8_ok, ra8_io_stream_bind(), and s_posix_stream_iface.
Referenced by internal_bind_diagnostic(), internal_output_init(), internal_output_init(), and main().