1 /* 2 * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include <sys/time.h> 8 #include <syscalls.h> 9 10 11 int 12 gettimeofday(struct timeval *tv, void *tz) 13 { 14 if (tv != NULL) { 15 bigtime_t usecs = real_time_clock_usecs(); 16 17 tv->tv_sec = usecs / 1000000; 18 tv->tv_usec = usecs % 1000000; 19 } 20 21 // struct timezone (tz) has been deprecated since long and its exact 22 // semantics are a bit unclear, so we need not bother to deal with it 23 24 return 0; 25 } 26