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

@@ -16,6 +16,7 @@ config_h = join(project_root, "include/l4/config.h")
env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
CCFLAGS = ['-g', '-std=gnu99', '-nostdlib', '-ffreestanding'],
LINKFLAGS = ['-nostdlib'],
CPPPATH = ['#include'],
ENV = {'PATH' : os.environ['PATH']},
LIBS = 'gcc')

17
tasks/libposix/time.c Normal file
View File

@@ -0,0 +1,17 @@
#include <l4lib/arch/syscalls.h>
#include <sys/time.h>
#include <errno.h>
int gettimeofday(struct timeval *tv, struct timezone *tz)
{
int ret = l4_time(tv, 0);
/* If error, return positive error code */
if (ret < 0) {
errno = -ret;
return -1;
}
/* else return value */
return ret;
}