diff --git a/src/kernel/libroot/posix/sys/Jamfile b/src/kernel/libroot/posix/sys/Jamfile index 1449bc306d..ecff55749f 100644 --- a/src/kernel/libroot/posix/sys/Jamfile +++ b/src/kernel/libroot/posix/sys/Jamfile @@ -6,6 +6,7 @@ KernelMergeObject posix_sys.o : <$(SOURCE_GRIST)>mkdir.c <$(SOURCE_GRIST)>select.c <$(SOURCE_GRIST)>sysctl.c + <$(SOURCE_GRIST)>gettimeofday.c : -fPIC -DPIC ; @@ -15,4 +16,5 @@ MergeObjectFromObjects kernel_posix_sys.o : <$(SOURCE_GRIST)>stat.o <$(SOURCE_GRIST)>mkdir.o <$(SOURCE_GRIST)>select.o + <$(SOURCE_GRIST)>gettimeofday.o ; diff --git a/src/kernel/libroot/posix/sys/gettimeofday.c b/src/kernel/libroot/posix/sys/gettimeofday.c new file mode 100644 index 0000000000..7e863abe6d --- /dev/null +++ b/src/kernel/libroot/posix/sys/gettimeofday.c @@ -0,0 +1,25 @@ +/* +** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the OpenBeOS License. +*/ + + +#include +#include + + +int +gettimeofday(struct timeval *tv, struct timezone *tz) +{ + bigtime_t usecs; + + if (tv == NULL) + return 0; + + usecs = real_time_clock_usecs(); + + tv->tv_sec = usecs / 1000000; + tv->tv_usec = usecs % 1000000; + + return 0; +}