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_adjtime(2) System Calls ntp_adjtime(2)NAME
ntp_adjtime - adjust local clock parameters
SYNOPSIS
#include <sys/timex.h>
int ntp_adjtime(struct timex *tptr);
DESCRIPTION
The ntp_adjtime() function adjusts the parameters used to discipline the local clock, according to the values in the struct timex pointed
to by tptr. Before returning, it fills in the structure with the most recent values kept in the kernel.
The adjustment is effected in part by speeding up or slowing down the clock, as necessary, and in part by phase-locking onto a once-per
second pulse (PPS) provided by a driver, if available.
struct timex {
uint32_t modes; /* clock mode bits (w) */
int32_t offset; /* time offset (us) (rw) */
int32_t freq; /* frequency offset (scaled ppm) (rw) */
int32_t maxerror; /* maximum error (us) (rw) */
int32_t esterror; /* estimated error (us) (rw) */
int32_t status; /* clock status bits (rw) */
int32_t constant; /* pll time constant (rw) */
int32_t precision; /* clock precision (us) (r) */
int32_t tolerance; /* clock frequency tolerance
(scaled ppm) (r) */
int32_t ppsfreq; /* pps frequency (scaled ppm) (r) */
int32_t jitter; /* pps jitter (us) (r) */
int32_t shift; /* interval duration (s) (shift) (r) */
int32_t stabil; /* pps stability (scaled ppm) (r) */
int32_t jitcnt; /* jitter limit exceeded (r) */
int32_t calcnt; /* calibration intervals (r) */
int32_t errcnt; /* calibration errors (r) */
int32_t stbcnt; /* stability limit exceeded (r) */
};
RETURN VALUES
Upon successful completion, ntp_adjtime() returns the current clock state (see <sys/timex.h>). Otherwise, it returns -1 and sets errno to
indicate the error.
ERRORS
The ntp_adjtime() function will fail if:
EFAULT The tptr argument is an invalid pointer.
EINVAL The constant member of the structure pointed to by tptr is less than 0 or greater than 30.
EPERM The {PRIV_SYS_TIME} privilege is not asserted in the effective set of the calling process.
SEE ALSO xntpd(1M), ntp_gettime(2), privileges(5)SunOS 5.11 1 Feb 2003 ntp_adjtime(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)