Table of Contentskernel_mktime - convert startup struct mktime into the number of seconds since 00:00:00 January 1, 1970 linux/kernel/mktime.c
long kernel_mktime(struct mktime * time);
This routine is called from time_init(void), linux/init/main.c. kernel_mktime() converts struct mktime (initialized from CMOS) into an encoded long. First an array, month[12], is created holding how many seconds has passed to reach a peculiar month, for a leap year. Next, it subtracts 70 from the current year, making 1970 the beginning year. It is math magic after this point, please look yourself. If you know why it does this, then send email (see nroff source). Returns the encoded time in a long linux/kernel/mktime.c home of routine
This routine is call only during startup of the kernel. Historically, the value (encoded long) counts the number of seconds since the Epoch, which occurred at 00:00:00 January 1, 1970 and is called Coordinated Universal Time (UTC). In older manuals, this event is called Greenwich Mean Time (GMT).
kernel_mktime() doesn't check to see if the year is greater than 1969. Be sure your CMOS is set correctly. It is customary to set on-board clocks to GMT and let processes who ask for the time to convert it to local time, if necessary. For kernel use only. Linus Torvalds
Table of Contents
www.fiveanddime.net