|
SafeAPI Backend POSIX
POSIX/Linux OAL backend for safeAPIFreamwork
|
POSIX sapi_log backend: non-blocking best-effort write to stderr (ADR-018 section 2.3), matching REQ-OAL-LOG-001 ("best-effort, non-blocking, must never affect caller control flow"). More...
Go to the source code of this file.
Functions | |
| static const char * | level_to_prefix (sapi_log_level_t level) |
| static sapi_status_t | backend_init (void) |
| static void | backend_write (sapi_log_level_t level, const char *tag, const char *message) |
| const sapi_log_backend_t * | sapi_posix_backend_log (void) |
| The POSIX sapi_log backend (non-blocking write to stderr). | |
Variables | |
| static const sapi_log_backend_t | s_posix_log_backend = { backend_init, backend_write } |
POSIX sapi_log backend: non-blocking best-effort write to stderr (ADR-018 section 2.3), matching REQ-OAL-LOG-001 ("best-effort, non-blocking, must never affect caller control flow").
Known simplification (stated in ADR-018): no queue, no separate drain thread - a direct fwrite() to stderr. stderr writes are typically fast enough in practice not to violate the non-blocking intent for a first cut, but a deployment wanting a hard non-blocking guarantee (stderr could be a slow pipe/tty under adversarial conditions) should route through a lock-free ring buffer drained by a dedicated low-priority thread instead. write() failures are silently ignored, per REQ-OAL-LOG-001 - logging must never affect caller control flow, so there is nothing meaningful to report back to the caller here.
Definition in file sapi_posix_backend_log.c.
|
static |
Definition at line 70 of file sapi_posix_backend_log.c.
|
static |
Definition at line 75 of file sapi_posix_backend_log.c.
|
static |
Local makros Local types declarations Local function declarations
Definition at line 45 of file sapi_posix_backend_log.c.
| const sapi_log_backend_t * sapi_posix_backend_log | ( | void | ) |
The POSIX sapi_log backend (non-blocking write to stderr).
Global variables declarations Global functions
Definition at line 37 of file sapi_posix_backend_log.c.
|
static |
Local variables declarations
Definition at line 31 of file sapi_posix_backend_log.c.