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 >
C/C++ Source or Header  |  1996-11-18  |  392b  |  19 lines

  1. int adjt(xx)
  2. double xx;
  3. {
  4. /*
  5.     this subroutine adjusts the time of the local clock
  6.     by xx seconds, where a positive value advances the
  7.     time and a negative value retards it.
  8. */
  9. #include <sys/time.h>
  10. #include "sizint.h"
  11. struct timeval delta;
  12. struct timeval olddelta;
  13. int j;
  14.     delta.tv_sec=(LONG) xx;
  15.     delta.tv_usec=(LONG)(1000000l*(xx-delta.tv_sec));
  16.     j=adjtime(&delta,&olddelta);
  17.     return(j);
  18. }
  19.