Time and related disasters in software (y2k38)
There are some opportunities to simplify:
-
BIND now targets POSIX, which gives us much more useful guarantees about the behaviour of
time_t
, so we can replace most uses ofisc_stdtime_t
. -
ISO C has adopted
struct timespec
so we can use that instead ofisc_time_t
. It is used for C's timed mutex and thread sleep.- This will need some care, though, because
isc_time_t
has unsigned members, whereasstruct timespec
is signed, for instance,long tv_nsec
. - On the other hand, 64 bit nanoseconds since the epoch is much easier to use than
struct timespec
orisc_time_t
- This will need some care, though, because
-
Most uses of time in BIND should probably be changed to use CLOCK_MONOTONIC instead of wall time
Edited by Tony Finch