GETTIME(2)
NAME
gettime − obtain the current local time in seconds past the epoch date
SYNOPSIS
int gettime(timvar)
long ∗timvar;
DESCRIPTION
Gettime obtains the local time measured in seconds past the epoch date, and places it in the longword pointed to by argument timvar. The epoch is taken to be zero seconds past Jan 1, 1970.
The correct time is usually kept by the real-time clock, but gettime may contact a time server on the network if the local time has not been initialized.
If gettime cannot obtain the current time, it returns SYSERR to the caller. Otherwise, gettime returns OK.
SEE ALSO
BUGS
Local time computation does not take daylight savings into account. The local clock may drift, especially under heavy CPU activity or activities that require the operating system to mask interrupts for extended periods.
December 01, 1986 — Xinu Programmer’s Manual