Changed time representation to posix style struct timeval/ gettimeofday.

This commit is contained in:
Bahadir Balban
2008-04-18 13:58:37 +01:00
parent 5563cc1c6b
commit cff7a505e8
5 changed files with 40 additions and 40 deletions

View File

@@ -15,6 +15,7 @@
#include <kdata.h>
#include <syscalls.h>
#include <task.h>
#include <posix/sys/time.h>
/*
* TODO:
@@ -99,7 +100,7 @@ void handle_fs_requests(void)
void main(void)
{
struct time_info ti;
struct timeval tv;
printf("\n%s: Started with tid: %d\n", __TASKNAME__, self_tid());
@@ -107,12 +108,11 @@ void main(void)
wait_pager(PAGER_TID);
if (l4_time(&ti, 0) < 0) {
if (gettimeofday(&tv, 0) < 0) {
printf("Reading the time has failed.\n");
} else {
printf("Current time since system started: %u ticks, "
"%u seconds, %u minutes, %u hours, %llu days.\n",
ti.thz, ti.sec, ti.min, ti.hour, ti.day);
printf("Current time since system started: %u useconds, "
"%u seconds.\n", tv.tv_usec, tv.tv_sec);
}
printf("%s: Listening requests.\n", __TASKNAME__);