时间虚拟化(6)

来源:互联网 发布:手机淘宝聊天记录没了 编辑:程序博客网 时间:2024/04/29 14:47

走下面哪条路径?

tools\ioemu-qemu-xen\vl.c

/***********************************************************/

/* host time/date access */

void qemu_get_timedate(struct tm *tm, int offset)

{

    time_t ti;

    struct tm *ret;

 

    time(&ti);

    ti += offset;

    if (rtc_date_offset == -1) {

        if (rtc_utc)

            ret = gmtime(&ti); //参数类型??

        else

            ret = localtime(&ti);

    } else {

        ti -= rtc_date_offset;

        ret = gmtime(&ti);

    }

 

    memcpy(tm, ret, sizeof(struct tm));

}

 

xen\common\time.cgmtime作用就是将时间格式化到一个结构体中,并将其返回。

原创粉丝点击