mirror of
https://github.com/falcosecurity/falco.git
synced 2026-04-11 06:23:50 +00:00
The previous commits used gmtime_r/localtime_r (unavailable on Windows) and assumed the GNU strerror_r variant returning char* (only on glibc). This broke macOS, musl, WASM, and Win32 builds. Add userspace/engine/compat.h with portable inline wrappers: - falco_gmtime_r / falco_localtime_r: use gmtime_s/localtime_s on Win32 - falco_strerror_r: returns const char* on all platforms, detecting glibc via __GLIBC__ (not _GNU_SOURCE alone, since musl defines _GNU_SOURCE but provides the XSI variant returning int) Also fixes a pre-existing bug in create_signal_handlers.cpp where the GNU strerror_r return value was incorrectly compared to 0 and the actual error string was discarded. Signed-off-by: Leonardo Grasso <me@leonardograsso.com>