mirror of
https://github.com/drasko/codezero.git
synced 2026-03-15 08:41:50 +01:00
Changed time representation to posix style struct timeval/ gettimeofday.
This commit is contained in:
@@ -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__);
|
||||
|
||||
Reference in New Issue
Block a user