diff options
author | jhb <jhb@FreeBSD.org> | 2001-02-23 19:44:25 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-02-23 19:44:25 +0000 |
commit | 1e88ca386bffcbae5e6b7b60bbdcd707648215ff (patch) | |
tree | db46e5a09cf4a3b7668c51a6cf7d827f50336ace /sys/kern/init_main.c | |
parent | 36e83fc67db5a70ae4c6fca1f68a78a6252caec1 (diff) | |
download | FreeBSD-src-1e88ca386bffcbae5e6b7b60bbdcd707648215ff.zip FreeBSD-src-1e88ca386bffcbae5e6b7b60bbdcd707648215ff.tar.gz |
Test out the kernel console just before launching the AP's.
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r-- | sys/kern/init_main.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 8eca076..3b68410 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -238,6 +238,30 @@ print_caddr_t(void *data __unused) } SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t, copyright) +static void +print_bday(void *data __unused) +{ + struct timeval tv; + int day; + + getmicrotime(&tv); + + /* + * We modulus by 126230400 (4*365.25*24*60*60) and then check each + * valid day in the four years covered by that interval to account + * for leap years. Note that this will break in 2100 AD. + */ + day = (tv.tv_sec % 126230400) / (24*60*60); + + /* + * Day 0 is Jan 1, so day 22 of Feb is Feb 23. Leap year was '72, + * so the third year in each set is a leap year. + */ + if ((day == (31+22)) || (day == (31+22+365)) || + (day == (31+22+365+365)) || (day == (31+22+365+365+366))) + printf("\t---===> Happy Birthday Peter!!! <===---\n"); +} +SYSINIT(bday, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, print_bday, NULL) /* *************************************************************************** |