ntp_gettime(2) System Calls ntp_gettime(2)NAME
ntp_gettime - get local clock values
SYNOPSIS
#include <sys/timex.h>
int ntp_gettime(struct ntptimeval *tptr);
DESCRIPTION
The ntp_gettime() function reads the local clock value and dispersion, returning the information in tptr.
The ntptimeval structure contains the following members:
struct ntptimeval {
struct timeval time; /* current time (ro) */
int32_t maxerror; /* maximum error (us) (ro) */
int32_t esterror; /* estimated error (us) (ro) */
};
RETURN VALUES
Upon successful completion, ntp_gettime() returns the current clock state (see <sys/timex.h>). Otherwise, it returns -1 and sets errno to
indicate the error.
ERRORS
The ntp_gettime() function will fail if:
EFAULT The tptr argument points to an invalid address.
The ntp_gettime() function will fail for 32-bit interfaces if:
EOVERFLOW The size of the time.tv_sec member of the ntptimeval structure pointed to by tptr is too small to contain the correct num-
ber of seconds.
SEE ALSO xntpd(1M), ntp_adjtime(2)SunOS 5.10 9 Nov 1999 ntp_gettime(2)
Check Out this Related Man Page
ntp_gettime(2) System Calls Manual ntp_gettime(2)NAME
ntp_gettime - Gets the date, time, and kernel time error values.
SYNOPSIS
#include <sys/timex.h>
int ntp_gettime (struct ntptimeval *tp);
PARAMETERS
Points to the ntptimeval structure in which information is returned. The ntptimeval structure is described in the sys/timex.h header file.
DESCRIPTION
The ntp_gettime() system call returns three read-only values in the ntptimeval structure. The ntptimeval structure members are as follows:
The current system time expressed as a Unix timeval structure. The timeval structure consists of two 32-bit words: the first is the number
of seconds past 1 January 1970 assuming no intervening leap-second insertions or deletions; and the second is the number of microseconds
within the second. The value of the time_maxerror kernel variable, which represents the maximum error of the indicated time relative to
the primary synchronization source, in microseconds. For NTP, the value is initialized to the synchronization distance, which is equal to
the root dispersion plus one-half the root delay. It is increased by a small amount (time_tolerance) each second to reflect the maximum
clock frequency error. This variable is modified by the kernel, but is otherwise not used by the kernel. The value of the time_esterror
kernel variable, which represents the expected error of the indicated time relative to the primary synchronization source, in microseconds.
For NTP, the value is determined as the root dispersion, which represents the best estimate of the actual error of the system clock based
on its past behavior, together with observations of multiple clocks within the peer group. This variable is not used by the kernel.
RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
If the ntp_gettime() function fails, errno may be set to one of the following values: The tp parameter points to a location outside of the
allocated address space of the process. The kernel was configured without the NTP_TIME option. delim off
ntp_gettime(2)
Hi.
i was wondering if anyone can show me or direct me on setting up a ntp server under redhat.. Is there any howtos so i can get familar to it "any good sites" (3 Replies)
Hello All
I have a problem about ntp, I am install a ntp server on a fedora 11 machine and I have 8 ntp client (solaris 10) everything working fine but just a server can not sync time . I have receive this error message
-bash-3.00# ntptime
ntp_gettime() returns code 5 (ERROR)
time... (1 Reply)
Hi,
I have 4 machines and all are NTP configured with same ntp.conf file. But 3 machines are in sync with Time server and 4th machine is not contacting & sync with the NTP server. Please see the below details.
# service ntpd stop
Stopping ntpd: ... (0 Replies)
Hi
I am trying to modify a C program to work for my needs. Problem is I don't know any real programming. I would really appreciate it if someone could help me!
Basically it is to get bandwidth speeds from a remote box. I have two terminal commands that get me the up and down speeds.
So how do... (8 Replies)
Someone, please help on this issue:-
Note : for security reason i didn't mention hostnames and ips.
==============================================================================
# ntpstat
unsynchronised
polling server every 1024 s
Ntpstat showing unsynchronised.
... (29 Replies)