home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
nisttime.carsoncity.k12.mi.us
/
nisttime.carsoncity.k12.mi.us.tar
/
nisttime.carsoncity.k12.mi.us
/
pub
/
lockclock
/
adjt.c
next >
Wrap
C/C++ Source or Header
|
1996-11-18
|
392b
|
19 lines
int adjt(xx)
double xx;
{
/*
this subroutine adjusts the time of the local clock
by xx seconds, where a positive value advances the
time and a negative value retards it.
*/
#include <sys/time.h>
#include "sizint.h"
struct timeval delta;
struct timeval olddelta;
int j;
delta.tv_sec=(LONG) xx;
delta.tv_usec=(LONG)(1000000l*(xx-delta.tv_sec));
j=adjtime(&delta,&olddelta);
return(j);
}