2 Copyright 2009-2013, The AROS Development Team. All rights reserved.
3 $Id: arosc_emul.c 48057 2013-09-08 21:21:07Z verhaegs $
6 #include <proto/exec.h>
8 #include <proto/timer.h>
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.
17 int gettimeofday (struct timeval
* tv
,struct timezone
* tz
)
19 struct MsgPort
* timerport
= CreateMsgPort();
20 struct timerequest
* timereq
= (struct timerequest
*)CreateIORequest(timerport
, sizeof(*timereq
));
25 if (OpenDevice("timer.device", UNIT_VBLANK
, (struct IORequest
*)timereq
, 0) == 0)
27 #define TimerBase ((struct Device *)timereq->tr_node.io_Device)
33 CloseDevice((struct IORequest
*)timereq
);
37 DeleteIORequest((struct IORequest
*)timereq
);
38 DeleteMsgPort(timerport
);