M. Warner Losh scripsit:
> Since the interface to the kernel is time_t, there's really no chance
> for the kernel to do anything smarter with leapseconds. gettimeofday,
> time and clock_gettime all return a time_t in different flavors.
It could be done in the C library, since the interface between the
kernel and libc is not defined, only the interface between libc and
userland programs proper.
> Kernels aren't written in these languages.
They don't have to be: the strong typing can be imposed by
convention. ISO C got this right: a time_t can be any numeric
type, and difftime is used to find the seconds between two time_t's.
POSIX decided to stick with the old count-of-seconds rules for
arithmetic purposes, while making time_t no longer an actual count
of seconds, as V7 Unix defined it to be.
--
John Cowan http://ccil.org/~cowan cowan_at_ccil.org
Mr. Henry James writes fiction as if it were a painful duty. --Oscar Wilde
Received on Sat Jan 06 2007 - 17:51:12 PST