core: Support time functions.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sat, 20 Oct 2018 12:18:04 +0000 (14:18 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sat, 20 Oct 2018 12:18:04 +0000 (14:18 +0200)
commit094bdac0bdcf51ecd8f994932b9760fe37b9015d
treec20ffba7bd95bea6cc3498adfdeed564e92add4b
parentddb74e0a4a7eb81de6df21b5f9ca326801106fc4
core: Support time functions.

* lib/linux/clock_gettime.c: New file, move from gnu.c.
* lib/linux/gettimeofday.c: New file, move from tcc.c.
* lib/linux/time.c: New file, move from tcc.c.
* lib/linux/libc.c: Include them.
* lib/linux/gnu.c (clock_gettime): Remove.
* lib/linux/tcc.c (time, gettimeofday): Remove.
* include/time.h (CLOCK_PROCESS_CPUTIME_ID): New define.
* src/posix.c (init_time, current_time, gettimeofday_,
seconds_and_nanoseconds_to_long, get_internal_run_time): New function.
* src/mes.c (scm_symbol_internal_time_units_per_second): New symbol.
(main): Call init_time.
include/time.h
lib/linux/clock_gettime.c [new file with mode: 0644]
lib/linux/gettimeofday.c [new file with mode: 0644]
lib/linux/gnu.c
lib/linux/libc.c
lib/linux/tcc.c
lib/linux/time.c [new file with mode: 0644]
scaffold/mini-mes.c
src/mes.c
src/posix.c