ftime.c 297 B

123456789101112131415
  1. #include <sys/types.h>
  2. ftime(p)
  3. struct { time_t time; unsigned short millitm;
  4. short timezone; short dstflag; } *p;
  5. {
  6. struct { long l1,l2; } t1,t2;
  7. if (gettimeofday(&t1,&t2) < 0) return -1;
  8. p->time = t1.l1;
  9. p->millitm = t1.l2/1000;
  10. p->dstflag = t2.l2;
  11. p->timezone = t2.l1;
  12. return 0;
  13. }