commit 36bde5e96ff85d2c13436014a738d11611178fc9 Author: zhaoxc0502 Date: Thu Jun 16 17:14:03 2022 +0800 linux_kernel Change-Id: I86d70a3d88e61dd224c878c5c9c33defffaf0102 diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index cc4dc2857..917c0993b 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1288,6 +1288,22 @@ int get_device_system_crosststamp(int (*get_time_fn) } EXPORT_SYMBOL_GPL(get_device_system_crosststamp); +/** + * do_gettimeofday - Returns the time of day in a timeval + * @tv: pointer to the timeval to be set + * + * NOTE: Users should be converted to using getnstimeofday() + */ +void do_gettimeofday(struct old_timeval32 *tv) +{ + struct timespec64 now; + + ktime_get_real_ts64(&now); + tv->tv_sec = now.tv_sec; + tv->tv_usec = now.tv_nsec/1000; +} +EXPORT_SYMBOL(do_gettimeofday); + /** * do_settimeofday64 - Sets the time of day. * @ts: pointer to the timespec64 variable containing the new time