ftp://ftp.smr.ru/pub/0/FreeBSD/releases/distfiles/xscreensaver-3.16.tar.gz
[xscreensaver] / utils / vms-gtod.c
1 /*
2  *      UNIX-style Time Functions, by pmoreau@cena.dgac.fr <Patrick MOREAU>
3  *      (picked up from XVMSUTILS unix emulation routines for VMS by
4  *       Trevor Taylor, Patrick Mahans and Martin P.J. Zinser)
5  *
6  * Permission to use, copy, modify, distribute, and sell this software and its
7  * documentation for any purpose is hereby granted without fee, provided that
8  * the above copyright notice appear in all copies and that both that
9  * copyright notice and this permission notice appear in supporting
10  * documentation.  No representations are made about the suitability of this
11  * software for any purpose.  It is provided "as is" without express or 
12  * implied warranty.
13  */
14 #include <stdio.h>
15 #include <signal.h>
16 #include <time.h>
17 #include "vms-gtod.h"
18
19 /*
20  *      gettimeofday(2) - Returns the current time
21  */
22
23 int gettimeofday(tv)
24 struct timeval  *tv;
25 {
26     timeb_t tmp_time;
27     ftime(&tmp_time);
28     tv->tv_sec  = tmp_time.time;
29     tv->tv_usec = tmp_time.millitm * 1000;
30     return (0);
31 }