mirror of
https://github.com/drasko/codezero.git
synced 2026-04-18 01:39:05 +02:00
Changed time representation to posix style struct timeval/ gettimeofday.
This commit is contained in:
@@ -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
17
tasks/libposix/time.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user