|
ProtoCore v0.0.2
Deterministic, zero-heap network stack for embedded targets
|
Reentrant UTC broken-down time, portable across the host and target toolchains. More...
#include <time.h>Go to the source code of this file.
Functions | |
| struct tm * | pc_gmtime_r (const time_t *epoch, struct tm *out) |
Convert epoch to broken-down UTC in caller storage (reentrant). | |
Reentrant UTC broken-down time, portable across the host and target toolchains.
Responses are formatted from worker threads, so every conversion must write into caller storage - never the shared static tm that gmtime() returns. The toolchains disagree on how to spell that: newlib and glibc have gmtime_r, the Windows CRT has only gmtime_s, with the arguments reversed. This is the one seam that hides the difference, so callers write it once.
Definition in file time_compat.h.
|
inline |
Convert epoch to broken-down UTC in caller storage (reentrant).
| epoch | Seconds since the Unix epoch. |
| out | Destination struct tm (must be non-null). |
out on success, or NULL if epoch cannot be represented. Definition at line 28 of file time_compat.h.
Referenced by pc_http_date().