{
char *p, *q;
char *password;
- struct timezone tz;
struct timeval now;
p = line;
*p = 0;
}
- if (gettimeofday(&now, &tz) < 0) {
+ if (gettimeofday(&now, NULL) < 0) {
printf("500 - Could not read time of day\n");
return 0;
} else {
calculate_sys_precision(void)
{
struct timeval tv, old_tv, first_tv;
- struct timezone tz;
int dusec, best_dusec;
int iters;
- gettimeofday(&old_tv, &tz);
+ gettimeofday(&old_tv, NULL);
first_tv = old_tv;
best_dusec = 1000000; /* Assume we must be better than a second */
iters = 0;
do {
- gettimeofday(&tv, &tz);
+ gettimeofday(&tv, NULL);
dusec = 1000000*(tv.tv_sec - old_tv.tv_sec) + (tv.tv_usec - old_tv.tv_usec);
old_tv = tv;
if (dusec > 0) {
void
LCL_ReadRawTime(struct timeval *result)
{
- struct timezone tz;
-
- if (gettimeofday(result, &tz) < 0) {
+ if (gettimeofday(result, NULL) < 0) {
LOG_FATAL(LOGF_Local, "gettimeofday() failed");
}
}
static void
update_slow_slew_error(int offset)
{
- struct timezone tz;
struct timeval now, newend;
if (offset == 0 && slow_slew_error == 0)
return;
- if (gettimeofday(&now, &tz) < 0) {
+ if (gettimeofday(&now, NULL) < 0) {
LOG_FATAL(LOGF_SysLinux, "gettimeofday() failed");
}
static void
update_nano_slew_error(long offset, int new)
{
- struct timezone tz;
struct timeval now;
double ago;
offset = -offset;
if (new || nano_slew_error_start.tv_sec > 0) {
- if (gettimeofday(&now, &tz) < 0) {
+ if (gettimeofday(&now, NULL) < 0) {
LOG_FATAL(LOGF_SysLinux, "gettimeofday() failed");
}
}
stop_fast_slew(void)
{
struct timeval T1;
- struct timezone tz;
double fast_slew_done;
double slew_duration;
assert(fast_slewing);
/* Now set the thing off */
- if (gettimeofday(&T1, &tz) < 0) {
+ if (gettimeofday(&T1, NULL) < 0) {
LOG_FATAL(LOGF_SysLinux, "gettimeofday() failed");
}
adjust_fast_slew(double old_tick, double old_delta_tick)
{
struct timeval tv, end_of_slew;
- struct timezone tz;
double fast_slew_done, slew_duration, dseconds;
assert(fast_slewing);
- if (gettimeofday(&tv, &tz) < 0) {
+ if (gettimeofday(&tv, NULL) < 0) {
LOG_FATAL(LOGF_SysLinux, "gettimeofday() failed");
}
long offset;
struct timeval T0;
struct timeval end_of_slew;
- struct timezone tz;
/* Don't want to get here if we already have an adjust on the go! */
assert(!fast_slewing);
dseconds = - offset_register * (current_total_tick + delta_total_tick) / delta_total_tick;
/* Now set the thing off */
- if (gettimeofday(&T0, &tz) < 0) {
+ if (gettimeofday(&T0, NULL) < 0) {
LOG_FATAL(LOGF_SysLinux, "gettimeofday() failed");
}
apply_step_offset(double offset)
{
struct timeval old_time, new_time;
- struct timezone tz;
double err;
if (fast_slewing) {
abort_slew();
}
- if (gettimeofday(&old_time, &tz) < 0) {
+ if (gettimeofday(&old_time, NULL) < 0) {
LOG_FATAL(LOGF_SysLinux, "gettimeofday() failed");
}
UTI_AddDoubleToTimeval(&old_time, -offset, &new_time);
- if (settimeofday(&new_time, &tz) < 0) {
+ if (settimeofday(&new_time, NULL) < 0) {
LOG_FATAL(LOGF_SysLinux, "settimeofday() failed");
}
- if (gettimeofday(&old_time, &tz) < 0) {
+ if (gettimeofday(&old_time, NULL) < 0) {
LOG_FATAL(LOGF_SysLinux, "gettimeofday() failed");
}
clock_initialise(void)
{
struct timeval newadj, oldadj;
- struct timezone tz;
offset_register = 0.0;
adjustment_requested = 0.0;
current_freq = 0.0;
- if (gettimeofday(&T0, &tz) < 0) {
+ if (gettimeofday(&T0, NULL) < 0) {
LOG_FATAL(LOGF_SysNetBSD, "gettimeofday() failed");
}
{
struct timeval newadj, oldadj;
struct timeval T1;
- struct timezone tz;
double elapsed, accrued_error;
double adjust_required;
struct timeval exact_newadj;
double old_adjust_remaining;
/* Determine the amount of error built up since the last adjustment */
- if (gettimeofday(&T1, &tz) < 0) {
+ if (gettimeofday(&T1, NULL) < 0) {
LOG_FATAL(LOGF_SysNetBSD, "gettimeofday() failed");
}
stop_adjust(void)
{
struct timeval T1;
- struct timezone tz;
struct timeval zeroadj, remadj;
double adjustment_remaining, adjustment_achieved;
double elapsed, elapsed_plus_adjust;
LOG_FATAL(LOGF_SysNetBSD, "adjtime() failed");
}
- if (gettimeofday(&T1, &tz) < 0) {
+ if (gettimeofday(&T1, NULL) < 0) {
LOG_FATAL(LOGF_SysNetBSD, "gettimeofday() failed");
}
apply_step_offset(double offset)
{
struct timeval old_time, new_time, T1;
- struct timezone tz;
stop_adjust();
- if (gettimeofday(&old_time, &tz) < 0) {
+ if (gettimeofday(&old_time, NULL) < 0) {
LOG_FATAL(LOGF_SysNetBSD, "gettimeofday() failed");
}
UTI_AddDoubleToTimeval(&old_time, -offset, &new_time);
- if (settimeofday(&new_time, &tz) < 0) {
+ if (settimeofday(&new_time, NULL) < 0) {
LOG_FATAL(LOGF_SysNetBSD, "settimeofday() failed");
}
clock_initialise(void)
{
struct timeval newadj, oldadj;
- struct timezone tz;
offset_register = 0.0;
adjustment_requested = 0.0;
current_freq = 0.0;
- if (gettimeofday(&T0, &tz) < 0) {
+ if (gettimeofday(&T0, NULL) < 0) {
LOG_FATAL(LOGF_SysSolaris, "gettimeofday() failed");
}
{
struct timeval newadj, oldadj;
struct timeval T1;
- struct timezone tz;
double elapsed, accrued_error;
double adjust_required;
struct timeval exact_newadj;
double old_adjust_remaining;
/* Determine the amount of error built up since the last adjustment */
- if (gettimeofday(&T1, &tz) < 0) {
+ if (gettimeofday(&T1, NULL) < 0) {
LOG_FATAL(LOGF_SysSolaris, "gettimeofday() failed");
}
stop_adjust(void)
{
struct timeval T1;
- struct timezone tz;
struct timeval zeroadj, remadj;
double adjustment_remaining, adjustment_achieved;
double elapsed, elapsed_plus_adjust;
LOG_FATAL(LOGF_SysSolaris, "adjtime() failed");
}
- if (gettimeofday(&T1, &tz) < 0) {
+ if (gettimeofday(&T1, NULL) < 0) {
LOG_FATAL(LOGF_SysSolaris, "gettimeofday() failed");
}
{
struct timeval old_time, new_time, rounded_new_time, T1;
double rounding_error;
- struct timezone tz;
stop_adjust();
- if (gettimeofday(&old_time, &tz) < 0) {
+ if (gettimeofday(&old_time, NULL) < 0) {
LOG_FATAL(LOGF_SysSolaris, "gettimeofday() failed");
}
UTI_DiffTimevalsToDouble(&rounding_error, &rounded_new_time, &new_time);
- if (settimeofday(&new_time, &tz) < 0) {
+ if (settimeofday(&new_time, NULL) < 0) {
LOG_FATAL(LOGF_SysSolaris, "settimeofday() failed");
}
clock_initialise(void)
{
struct timeval newadj, oldadj;
- struct timezone tz;
offset_register = 0.0;
adjustment_requested = 0.0;
current_freq = 0.0;
- if (gettimeofday(&T0, &tz) < 0) {
+ if (gettimeofday(&T0, NULL) < 0) {
LOG_FATAL(LOGF_SysSunOS, "gettimeofday() failed");
}
{
struct timeval newadj, oldadj;
struct timeval T1;
- struct timezone tz;
double elapsed, accrued_error;
double adjust_required;
struct timeval exact_newadj;
long remainder, multiplier;
/* Determine the amount of error built up since the last adjustment */
- if (gettimeofday(&T1, &tz) < 0) {
+ if (gettimeofday(&T1, NULL) < 0) {
LOG_FATAL(LOGF_SysSunOS, "gettimeofday() failed");
}
stop_adjust(void)
{
struct timeval T1;
- struct timezone tz;
struct timeval zeroadj, remadj;
double adjustment_remaining, adjustment_achieved;
double gap;
LOG_FATAL(LOGF_SysSunOS, "adjtime() failed");
}
- if (gettimeofday(&T1, &tz) < 0) {
+ if (gettimeofday(&T1, NULL) < 0) {
LOG_FATAL(LOGF_SysSunOS, "gettimeofday() failed");
}
apply_step_offset(double offset)
{
struct timeval old_time, new_time, T1;
- struct timezone tz;
stop_adjust();
- if (gettimeofday(&old_time, &tz) < 0) {
+ if (gettimeofday(&old_time, NULL) < 0) {
LOG_FATAL(LOGF_SysSunOS, "gettimeofday() failed");
}
UTI_AddDoubleToTimeval(&old_time, -offset, &new_time);
- if (settimeofday(&new_time, &tz) < 0) {
+ if (settimeofday(&new_time, NULL) < 0) {
LOG_FATAL(LOGF_SysSunOS, "settimeofday() failed");
}
is only 32-bit */
if (sizeof (time_t) > 4 && sec_high == TV_NOHIGHSEC) {
struct timeval now;
- struct timezone tz;
- gettimeofday(&now, &tz);
+ gettimeofday(&now, NULL);
sec_high = now.tv_sec >> 16 >> 16;
}
dest->tv_sec = (time_t)sec_high << 16 << 16 | sec_low;