INITTODR(9) BSD Kernel Developer's Manual INITTODR(9)NAME
inittodr -- initialize system time
SYNOPSIS
void
inittodr(time_t base);
DESCRIPTION
The inittodr() function determines the time and sets the system clock. It tries to pick the correct time using a set of heuristics that
examine the system's battery-backed clock and the time reported by the file system, as given in base. Those heuristics include:
o If the battery-backed clock has a valid time, and is not significantly behind the time provided by base, it is used.
o If the battery-backed clock does not have a valid time, or is significantly behind the time provided in base, and the time provided in
base is within reason, base is used as the current time.
o If the battery-backed clock appears invalid, and base appears non-sensical or was not provided (was given as zero), an arbitrary base
(typically some time within the same year that the kernel was last updated) will be used.
Once a system time has been determined, it is stored in the time variable.
DIAGNOSTICS
The inittodr() function prints diagnostic messages if it has trouble figuring out the system time. Conditions that can cause diagnostic mes-
sages to be printed include:
o There is no battery-backed clock present on the system.
o The battery-backed clock's time appears nonsensical.
o The base time appears nonsensical.
o The base time and the battery-backed clock's time differ by a large amount.
SEE ALSO clock_ymdhms_to_secs(9), resettodr(9), time_second(9)BUGS
Some systems use heuristics for picking the correct time that are slightly different.
BSD September 6, 2006 BSD
Check Out this Related Man Page
INITTODR(9) BSD Kernel Developer's Manual INITTODR(9)NAME
inittodr -- initialize system time
SYNOPSIS
#include <sys/types.h>
#include <sys/systm.h>
void
inittodr(time_t base);
DESCRIPTION
The inittodr() function determines the time and sets the system clock. It tries to pick the correct time using a set of heuristics that
examine the system's battery backed clock and the time obtained from the root file system, as given in base. How the base value is obtained
will vary depending on the root file system type. The heuristics used include:
o If the battery-backed clock has a valid time, it is used.
o If the battery-backed clock does not have a valid time, the time provided in base will be used.
Once a system time has been determined, it is stored in the time variable.
DIAGNOSTICS
The inittodr() function prints diagnostic messages if it has trouble figuring out the system time. Conditions that can cause diagnostic mes-
sages to be printed include:
o The battery-backed clock's time appears nonsensical.
SEE ALSO resettodr(9), time(9)BUGS
On many systems, inittodr() has to convert from a time expressed in terms of year, month, day, hours, minutes, and seconds to time, expressed
in seconds. Many of the implementations could share code, but do not.
Each system's heuristics for picking the correct time are slightly different.
The FreeBSD implementation should do a better job of validating the time provided in base when the battery-backed clock is unusable. Cur-
rently it unconditionally sets the system clock to this value.
BSD March 22, 1997 BSD
i am setting up a BSD firewall for the first time. I have recompiled the kernel and all that, but am having trouble building a good ruleset. I have read the manpages but am still having trouble creating what I need. It is either nothing is going through or everything is. Does anybody know of a... (3 Replies)
I thought that access time of a file is time when the file was run last time (or I read somewhere that it's time when system lookup the file -> but I'm not sure when it really is)
How is it exactly?
Thank you for help! (11 Replies)
Hi Guys,
Hopefully someone would be able to help me out. Basically I have an HPUX 11.11i system which is backed up by Data Protector 4.5. Every so often the vdba process hangs and chews up 100% of one of the systems CPU resources. As our monitoring tool can only monitor on a per system basis... (3 Replies)
This is my first post and right off the bat, I want to let you know that my experience in UNIX is 2 days only backed up with over 20 years of IT working. So, if this is a dumb question or too stupid, please bear with me.
I read somewhere on the web and also on these forums that you can map your... (7 Replies)
Hi all,
My Sun StorageTek 2540 have redundant batteries, but a battery was failed.
# /opt/SUNWstkcam/bin/sscs list -d MyStorage1 fru
Name FRU Alarm State Status Revision Unique Id
-------------------------- ----------- --------... (2 Replies)
Hi all,
how to get the same time in two systems,
for example:
in one system i have the correct time, and second system i have wrong time.
now i want the first sytem to second sytem, i dont to want to do this work manually.
i know there is one command to get the time. in ntp.
... (3 Replies)
This is a strange one, I've never seen anything like it; the realtime clock doesn't tick while the computer's idle, only when you're watching it. Leave for 3 hours and it'll be 3 hours off. It still advances when it's off however, or the time would be far more incorrect than it is.
About all... (10 Replies)
My TOD battery of IBM 285 is dead
Fast question: i have to buy an original battery(there is only one on ebay!)
Or i can use a normal lithium battery for pc bios?
Thanks (2 Replies)
Hi ,I got one data file from external source and I have to load it in database through sql loader. I want to add 2 columns in database,one is file name and one is time of the file received on server.
-rwxr-x--- 1 user user 238 Jun 03 16:32 90936264971326030616.ctr
From above case,... (21 Replies)
I have an expect script that appears to be working normally however for some reason, the remote side appears to be stripping off the variables from the awk command.
This is the original:
expect \"~]$\"
send \"sed 's/=/ /g;s/,/ /g' /home/file.txt | grep abc | awk '{print $6,$8}'This is the... (5 Replies)
Hello All,
OS: openSUSE 13.1 (Bottle) (armv7hl)
PC: CuBox-i (*mini-pc)
The PC in question is a CuBox-i mini-pc. Since this PC doesn't have a battery, everytime the PC reboots the hardware clock is reset back to the same date every time, which is "2014-07-08 00:00".
I have NTP configured... (5 Replies)
Hi Everybody,
Hope everybody is having fun with their Solaris installations and not pulling out too much of whatever hair they have left so far. :)
Just for sport, I bought an old Netra 240 used by Northern Telecom Turkish subsidiary Netas here in Turkey. My hope is to turn this into an ugly... (33 Replies)
Hi.
I'm wondering if it is possible to execute system(), if a certain string of text appears on the screen or not?
I want to be able to run system("rz -Z") based on if "B00000000000000" appears on the screen.
rz is a program to recieve files via Zmodem protocol. Is this possible? In C, of... (3 Replies)