File: gettimeofday.c

package info (click to toggle)
hamlib 4.6.5-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,984 kB
  • sloc: ansic: 262,996; sh: 6,135; cpp: 1,578; perl: 876; makefile: 855; python: 148; awk: 58; xml: 26
file content (32 lines) | stat: -rw-r--r-- 443 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

#include <hamlib/config.h>

#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
#ifdef HAVE_WINBASE_H
# include <winbase.h>
#endif

#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif

/*
 * broken implementation for WIN32.
 * FIXME: usec precision
 */
int gettimeofday(struct timeval *tv, struct timezone *tz)
{
    if (tv)
    {
        time_t tm;

        time(&tm);
        tv->tv_sec = tm;
        tv->tv_usec = 0;
    }

    return 0;
}