Debian Codegraph @

compat/gettod.c

raw
1 /*
2 * gettod.c --
3 *
4 * This file provides the gettimeofday function on systems
5 * that only have the System V ftime function.
6 *
7 * Copyright (c) 1995 Sun Microsystems, Inc.
8 *
9 * See the file "license.terms" for information on usage and redistribution
10 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11 */
12
13 #include "tclPort.h"
14 #include <sys/timeb.h>
15
16 #undef timezone
17
18 int
19 gettimeofday(
20 struct timeval *tp,
21 struct timezone *tz)
22 {
23 struct timeb t;
24 (void)tz;
25
26 ftime(&t);
27 tp->tv_sec = t.time;
28 tp->tv_usec = t.millitm * 1000;
29 return 0;
30 }
31