Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / hidds / nouveau / arosc_emul.c
blobff51984e73302f0f809777f9226b89d35f073bc2
1 /*
2 Copyright 2009-2013, The AROS Development Team. All rights reserved.
3 $Id$
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;