Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

inittodr(9) [netbsd man page]

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
Man Page

14 More Discussions You Might Find Interesting

1. IP Networking

BSD Firewall

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)
Discussion started by: deadletter
3 Replies

2. UNIX for Dummies Questions & Answers

Extract TIME

Hey guys. How would I go about extracting the time from the system clock and inserting it into a variable? Any thoughts? (4 Replies)
Discussion started by: ndoggy020
4 Replies

3. UNIX for Dummies Questions & Answers

Access time of a file

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)
Discussion started by: MartyIX
11 Replies

4. HP-UX

HPUX monitoring and alerting script per CPU

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)
Discussion started by: fulhamfcboy
3 Replies

5. UNIX for Dummies Questions & Answers

Mapping PF Keys in Vi

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)
Discussion started by: sssccc
7 Replies

6. Hardware

StorageTek 2540 battery failed

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)
Discussion started by: buyantugs
2 Replies

7. UNIX for Dummies Questions & Answers

how to get the same time in two systems,

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)
Discussion started by: anishkumarv
3 Replies

8. Windows & DOS: Issues & Discussions

Clock doesn't tick

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)
Discussion started by: Corona688
10 Replies

9. AIX

TOD battery dead

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)
Discussion started by: Linusolaradm1
2 Replies

10. Shell Programming and Scripting

How to pick system time of the file placed on UNIX?

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)
Discussion started by: Ruchika
21 Replies

11. UNIX for Beginners Questions & Answers

Expect question

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)
Discussion started by: jimmyf
5 Replies

12. UNIX for Beginners Questions & Answers

DHCP Issue Possibly due to Hardware Clock?

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)
Discussion started by: mrm5102
5 Replies

13. Solaris

Help with Reviving a NETRA240 Pls?

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)
Discussion started by: ozsavran
33 Replies

14. UNIX for Beginners Questions & Answers

Calling system() if certain text appears on the screen.

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)
Discussion started by: ignatius
3 Replies