4 ms·
> The point is that the kernel doesn't keep the time as time_t. Does the kernel (linux or VMS) care about absolute calendar time at all? time_t is a strictly u
by jiveturkey 7y ago
> The point is that the kernel doesn't keep the time as time_t.
Does the kernel (linux or VMS) care about absolute calendar time at all? time_t is a strictly userspace construct is it not?
- asveikau 7y agoShort answer is yes it does. One example where the kernel needs to care is that the filesystem maintains the last write time on files. I am sure there are many others. And if not having the kernel store a time somewhere, where must it come from? Userspace cannot fabricate it from nothing. Even if the kernel used some "relative" thing, where does the base offset come from? However you answer that, keep in mind all processes have to agree, writing it needs to be privileged, it might need to read and write a hardware clock, etc., all problems storing it in the kernel solves. Also keep in mind that time_t is not a "calendar" construct, it is an integer, and it's not time zone specific. User mode can and does build calendars and time zones on top.