NAME

SYNOPSIS

DESCRIPTION

This function uses the Time Server Protocol as described in
RFC 868 to obtain the time from a remote machine.

The Time Server Protocol gives the time in seconds since
00:00:00 UTC, 1 Jan 1900,
and this function subtracts the appropriate constant in order to
convert the result to seconds since the
Epoch, 1970-01-01 00:00:00 +0000 (UTC).

When
timeout
is non-NULL, the udp/time socket (port 37) is used.
Otherwise, the tcp/time socket (port 37) is used.

RETURN VALUE

On success, 0 is returned, and the obtained 32-bit time value is stored in
timep->tv_sec.
In case of error -1 is returned, and
errno
is set appropriately.

SEE ALSO

COLOPHON

This page is part of release 3.74 of the Linux
man-pages
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
http://www.kernel.org/doc/man-pages/.