tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Support for tv_sec=-1 (one second before the epoch) timestamps?
n54%gmx.com@localhost (Kamil Rytarowski) writes:
>I disagree, this used to be a flaw in C/POSIX interface to keep one
>specific point of time invalid. It should be fixed similarly to other OSe=
>s.
negative time_t values don't specify a point in time. The talk about
"one specific point of time invalid" is nonsense.
>Maintaining signed (negative) time_t is another and more generic topic.
>In real life it's often needed to store time_t pointing before the UNIX
>epoch.
time_t is signed so that it can also be used to store time differences. There
the value -1 is not invalid. It is also necessary that absolute time_t values
(== point in time) are non-negative to avoid overflows when calculating a
difference.
--
--
Michael van Elst
Internet: mlelstv%serpens.de@localhost
"A potential Snark may lurk in every tree."
Home |
Main Index |
Thread Index |
Old Index