Skip to content

C11 atomics

Setup

Platform/StdAtomic/ is a portable AtomicCounter built on C11 <stdatomic.h> - the sequenceId source on any target with a C11 compiler, no OS dependency.

Fills the AtomicCounter role.

What it ships

Header What it is
SolidSyslogStdAtomicCounter.h An AtomicCounter over C11 <stdatomic.h>, backing the RFC 5424 sequenceId.
SolidSyslogStdAtomicCounterErrors.h Source identity for the StdAtomicCounter adapter; the detail codes it reports are the portable ones in SolidSyslogAtomicCounterErrors.h.

Requirements

A C11 compiler with <stdatomic.h>. Where a toolchain lacks it, the capability matrix shows which other platforms fill the AtomicCounter role. The pack is tested with GNU 14.2.0 and Clang 19.1.7 in CI.

Security behaviour and obligations

The sequence wraps, and a collector must expect it

Values run in [1, 2^31 - 1] and skip zero on wrap. A long-lived device will reuse numbers, so collector-side gap detection has to treat wrap as ordinary rather than as a discontinuity.

It evidences loss, not origin

sequenceId is a plain counter, not a cryptographic construction. It shows that a record is missing; it does not bind a record to the device that raised it, and it can be reproduced by anything that can write records.