bind9/doc/man/stdtime.man
2000-06-01 03:19:06 +00:00

60 lines
2 KiB
Groff

.\"
.\" Copyright (C) 2000 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this document for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
.\" DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
.\" INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
.\" FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
.\" NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
.\" WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: stdtime.man,v 1.1 2000/06/01 03:19:06 jim Exp $
.\"
.Dd Jun 30, 2000
.Dt STDTIME 3
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm isc_stdtime_get
.Nd get the current date and time
.Sh SYNOPSIS
.Fd #include <config.h>
.Fd #include <sys/time.h>
.Fd #include <isc/stdtime.h>
.Fd #include <isc/util.h>
.Ft void
.Fn isc_stdtime_get "isc_stdtime_t *t"
.Sh DESCRIPTION
.Fn isc_stdtime_get
sets
.Fa t
to the number of seconds since the UNIX epoch, 00:00:00 UTC, January
1, 1970.
.Sh SEE ALSO
.Xr gettimeofday 2 ,
.Xr isc_time_now 3
.Sh BUGS
A time synchronisation protocol such as NTP is needed to ensure that
the kernel's concept of the current time is accurate.
.Pp
At 03:14:08 GMT on Tue Jan 19 2038, the number of seconds since
the UNIX epoch will overflow a 32-bit signed integer.
This may cause unpredictable behaviour on systems which treat these
timestamps as 32-bit signed quantities.
.Dv isc_stdtime_t
is defined as a 32-bit unsigned quantity, which means
.Fn isc_stdtime_get
will be safe until some time in 2106.
Applications that
want maximum portability should not assume anything about the size
of a
.Dv isc_stdtime_t .