/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include #include #include int ftime(struct timeb *tp) { struct timeval tv; struct timezone tz; if (gettimeofday(&tv, &tz) < 0) return -1; tp->time = tv.tv_sec; tp->millitm = tv.tv_usec / 1000; tp->timezone = tz.tz_minuteswest; tp->dstflag = tz.tz_dsttime; return 0; }