Commit Graph

5 Commits

Author SHA1 Message Date
Gilles Peskine
2393fddd60 clock_gettime: don't assume more than 1 second since the origin of time
With e.g. `CLOCK_BOOTTIME`, it's plausible that less than 1 second has
passed since the boot reference time.

Only assert that the returned time is nonzero (because all-bits-zero is
highly implausible as an actual clock value, but likely indicates that the
intended value was not copied out correctly).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-03 15:19:58 +01:00
Gilles Peskine
5c6ec6bcc0 Add smoke test for gettimeofday()
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-03 15:19:58 +01:00
Gilles Peskine
60cfb78882 Fix the build on non-Unix-like platforms that define CLOCK_REALTIME as a macro
Needed for MinGW builds in our CI.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-03 15:19:58 +01:00
Gilles Peskine
f994fe05cd Fix the build on non-UNIXLIKE platforms
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-03 15:19:58 +01:00
Gilles Peskine
df9fdae4c4 Add smoke test for availability of some Unix functions
The goal isn't to do any functional testing, but to have a simple diagnostic
if some Unix platform function isn't available, and to have a record of
success in the outcome file.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-03 15:19:58 +01:00