disable debug
[AROS.git] / workbench / hidds / vmwaresvga / arosc_emul.c
blob307e519739e659b1d05b228d42a91b159ad73f3e
1 /*
2 Copyright 2009-2013, The AROS Development Team. All rights reserved.
3 $Id: arosc_emul.c 48057 2013-09-08 21:21:07Z verhaegs $
4 */
6 #include <proto/exec.h>
7 #include <proto/dos.h>
8 #include <proto/timer.h>
10 /*
11 The purpose of this file is to provide implementation for C functions part
12 of arosnixc.library in code where one does not want to use this library.
15 struct timezone;
17 int gettimeofday (struct timeval * tv,struct timezone * tz)
19 struct MsgPort * timerport = CreateMsgPort();
20 struct timerequest * timereq = (struct timerequest *)CreateIORequest(timerport, sizeof(*timereq));
23 if (timereq)
25 if (OpenDevice("timer.device", UNIT_VBLANK, (struct IORequest *)timereq, 0) == 0)
27 #define TimerBase ((struct Device *)timereq->tr_node.io_Device)
29 GetSysTime(tv);
31 #undef TimerBase
33 CloseDevice((struct IORequest *)timereq);
37 DeleteIORequest((struct IORequest *)timereq);
38 DeleteMsgPort(timerport);
40 return 0;