How to Solve Android Linux5.10 Kernel do_gettimeofday Function Error

Android Linux 5.10 kernel do_gettimeofday function prompt does not exist.

Solution: Replace with ktime_get_real_ts64 function.

Specific examples:

Code before modification:

    struct  timeval   time_now;
	struct rtc_time tm; 
	rtc_time_to_tm(time_now.tv_sec, &tm); 

Code after modification:

	struct timespec64 ts64;
	struct rtc_time tm; 
	tm = rtc_ktime_to_tm(ts64.tv_sec); 

Read More: