Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
2 | #include |
||
3 | #include |
||
4 | #include |
||
5 | |||
6 | int |
||
7 | ftime(struct timeb *tp) |
||
8 | { |
||
9 | struct timeval tv; |
||
10 | struct timezone tz; |
||
11 | |||
12 | if (gettimeofday(&tv, &tz) < 0) |
||
13 | return -1; |
||
14 | |||
15 | tp->time = tv.tv_sec; |
||
16 | tp->millitm = tv.tv_usec / 1000; |
||
17 | tp->timezone = tz.tz_minuteswest; |
||
18 | tp->dstflag = tz.tz_dsttime; |
||
19 | |||
20 | return 0; |
||
21 | }> |