2
当我尝试设置计算机硬件时钟喜欢这里descripted:设置硬件时钟不工作
How Do You Programmatically Set the Hardware Clock on Linux?
它不工作(时间未更新为新的时间)。
fd = open("/dev/rtc", O_RDONLY); //<- return 3
ioctl(fd, RTC_SET_TIME, &rt); //<- return 0
当我添加
system("/sbin/hwclock --systohc");
我得到:
无法通过 访问硬件时钟的任何已知方法
从终端执行hwclock的--systohc加工。
这是一个在VirtualBox中的Ubuntu 10.10 mashine。
使用代码:: Blocks的10.05与GCC我4.4.5
这里是我的全部源代码:
是的,我执行PROGRAMM为根。
VirtualBox是否不模拟虚拟RTC? – NKnusperer 2010-11-28 20:08:25