示例#1
0
文件: timer.c 项目: xwlan/flinux
DEFINE_SYSCALL(gettimeofday, struct timeval *, tv, struct timezone *, tz)
{
	log_info("gettimeofday(0x%p, 0x%p)", tv, tz);
	if (tz)
		log_error("warning: timezone is not NULL");
	if (tv)
	{
		FILETIME system_time;
		win7compat_GetSystemTimePreciseAsFileTime(&system_time);
		filetime_to_unix_timeval(&system_time, tv);
	}
	return 0;
}
示例#2
0
文件: timer.c 项目: geek-li/flinux
DEFINE_SYSCALL(gettimeofday, struct timeval *, tv, struct timezone *, tz)
{
	log_info("gettimeofday(0x%p, 0x%p)\n", tv, tz);
	if (tz)
		log_error("warning: timezone is not NULL\n");
	if (tv)
	{
		/* TODO: Use GetSystemTimePreciseAsFileTime() on Windows 8 */
		FILETIME system_time;
		GetSystemTimeAsFileTime(&system_time);
		filetime_to_unix_timeval(&system_time, tv);
	}
	return 0;
}