vbox: use libc's 'gettimeofday()' function

Fixes #1363
This commit is contained in:
Christian Prochaska 2015-01-13 17:38:04 +01:00 committed by Christian Helmuth
parent 4be7b3c3ad
commit 6791fd18cc
4 changed files with 6 additions and 25 deletions

View File

@ -111,9 +111,9 @@ append config {
<start name="virtualbox" priority="-2">
<resource name="RAM" quantum="448M"/>
<config vbox_file="test.vbox" vm_name="TestVM">
<libc stdout="/dev/log" stderr="/dev/log">
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc">
<vfs>
<dir name="dev"> <log/> </dir>}
<dir name="dev"> <log/> <rtc/> </dir>}
append_if [expr $use_serial] config {
<dir name="dev"> <terminal/> </dir>}

View File

@ -18,14 +18,14 @@ set config_of_app {
<binary name="virtualbox" />
<resource name="RAM" quantum="1280M"/>
<config vbox_file="vm_auto_disk.vbox" vm_name="AutoDisk">
<libc stdout="/dev/log" stderr="/dev/log">
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc">
<vfs>}
append_if [expr $use_ram_fs] config_of_app {
<dir name="ram"> <fs label="from_ram_fs"/> </dir>}
append config_of_app {
<dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> <rtc/> </dir>
<rom name="vm_auto_disk.vbox" />
<fs />
</vfs>

View File

@ -187,9 +187,9 @@ set config_of_app {
<binary name="virtualbox" />
<resource name="RAM" quantum="1280M"/>
<config vbox_file="vm_auto_share.vbox" vm_name="AutoDisk">
<libc stdout="/dev/log" stderr="/dev/log">
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc">
<vfs>
<dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> <rtc/> </dir>
<rom name="vm_auto_share.vbox" />}
append_if [expr $use_ram_fs] config_of_app {

View File

@ -143,25 +143,6 @@ extern "C" int sigaction(int signum, const struct sigaction *act,
}
/**
* Used by RTTimeNow
*/
extern "C" int gettimeofday(struct timeval *tv, struct timezone *tz)
{
if (!tv)
return -1;
try {
static Rtc::Connection rtc;
/* we need only seconds, current_time in microseconds */
tv->tv_sec = rtc.get_current_time() / 1000000ULL;
tv->tv_usec = rtc.get_current_time() % 1000000ULL * 1000;
return 0;
} catch (...) {
return -1;
}
}
/* our libc provides a _nanosleep function */
extern "C" int _nanosleep(const struct timespec *req, struct timespec *rem);
extern "C" int nanosleep(const struct timespec *req, struct timespec *rem)