2 ms·
Short 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
by asveikau 7y ago
Short 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.